tor-browser

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

shared-worker-partitioned.tentative.html (828B)


      1 <!DOCTYPE html>
      2 <meta charset="utf-8">
      3 <title>Test partitioning of shared workers</title>
      4 <script src="/resources/testharness.js"></script>
      5 <script src="/resources/testharnessreport.js"></script>
      6 <script src="/common/get-host-info.sub.js"></script>
      7 
      8 <body>
      9 <script>
     10 async function onload() {
     11  const worker = new SharedWorker("support/shared-name.js");
     12 
     13  let e = await new Promise((r) => {worker.port.onmessage = r});
     14  assert_equals(e.data.counter, 1);
     15 
     16  const third_party_url = new URL(
     17      'support/window-sw-shared-name.html',
     18      get_host_info().HTTP_NOTSAMESITE_ORIGIN + self.location.pathname);
     19 
     20  third_party_window = window.open(third_party_url);
     21 
     22  e = await new Promise((r) => {window.onmessage = r});
     23  assert_equals(e.data.counter, 1);
     24 
     25  third_party_window.close();
     26 }
     27 
     28 promise_test(onload);
     29 </script>
     30 </body>