| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <script src="../resources/testharness.js"></script> | |
| 3 <script src="../resources/testharnessreport.js"></script> | |
| 4 <script src="resources/test-helpers.js"></script> | |
| 5 <script src="resources/registration-tests.js"></script> | |
| 6 <body> | |
| 7 <script> | |
| 8 | |
| 9 function registerUsingLink(script, options) { | |
| 10 var scope = options.scope; | |
| 11 var link = document.createElement('link'); | |
| 12 link.setAttribute('rel', 'serviceworker'); | |
| 13 link.setAttribute('href', script); | |
| 14 link.setAttribute('scope', scope); | |
| 15 document.getElementsByTagName('head')[0].appendChild(link); | |
| 16 return new Promise(function(resolve, reject) { | |
| 17 link.onload = resolve; | |
| 18 link.onerror = reject; | |
| 19 }) | |
| 20 .then(() => navigator.serviceWorker.getRegistration(scope)); | |
| 21 } | |
| 22 | |
| 23 registration_tests(registerUsingLink, false); | |
| 24 | |
| 25 </script> | |
| OLD | NEW |