Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <html> | |
| 3 <head> | |
| 4 <title>INITIAL</title> | |
| 5 <script> | |
| 6 var queryString = location.search; | |
| 7 | |
| 8 if (queryString && queryString.charAt(0) === '?') { | |
| 9 // Fetches the URL provided in query string with a custom header. | |
| 10 fetch(queryString.substring(1), | |
| 11 {headers: {'X-Custom-Header': 'foo'}}).then(function(data) { | |
| 12 data.text().then(function(text) { | |
| 13 document.title = text; | |
| 14 }); | |
|
falken
2016/04/06 04:41:36
nit: Service worker test code likes to chain promi
Raj
2016/04/06 05:08:42
Done. Nice.
| |
| 15 }).catch(function() { | |
| 16 document.title = "FAIL"; | |
|
falken
2016/04/06 04:41:36
Use single-quotes for consistency.
Raj
2016/04/06 05:08:42
Done.
| |
| 17 }); | |
| 18 } | |
| 19 </script> | |
| 20 </head> | |
| 21 </html> | |
| OLD | NEW |