1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17

content / test / data / sxg / service-worker.html [blame]

<script>
async function register(script, scope) {
  const registration = await navigator.serviceWorker.register(
      script, {scope: scope})
  await new Promise(resolve =>
    registration.installing.addEventListener('statechange', resolve));
}
async function initialize() {
  await register('service-worker.js?generated', './sw-scope-generated/');
  await register('service-worker.js?navigation-preload',
                 './sw-scope-navigation-preload/');
  await register('service-worker.js?no-respond-with',
                 './sw-scope-no-respond-with/');
  document.title = "Done";
}
initialize();
</script>