tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

service-worker-header.https.html (924B)


      1 <!DOCTYPE html>
      2 <title>Service Worker: Service-Worker header</title>
      3 <script src="/resources/testharness.js"></script>
      4 <script src="/resources/testharnessreport.js"></script>
      5 <script src="resources/test-helpers.sub.js"></script>
      6 <script>
      7 
      8 promise_test(async t => {
      9  const script = 'resources/service-worker-header.py'
     10    + '?header&import=service-worker-header.py?no-header';
     11  const scope = 'resources/service-worker-header';
     12  const expected_url = normalizeURL(script);
     13  const registration =
     14    await service_worker_unregister_and_register(t, script, scope);
     15  t.add_cleanup(() => registration.unregister());
     16  assert_true(registration instanceof ServiceWorkerRegistration);
     17 
     18  await wait_for_state(t, registration.installing, 'activated');
     19  await registration.update();
     20 }, 'A request to fetch service worker main script should have Service-Worker '
     21  + 'header and imported scripts should not have one');
     22 
     23 </script>