tor-browser

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

claim-nested-worker-fetch-iframe.html (485B)


      1 <!doctype html>
      2 <script>
      3 // An iframe that starts a nested worker. Our parent frame (the test page) calls
      4 // fetch_in_worker() to ask the nested worker to perform a fetch to see whether
      5 // it's controlled by a service worker.
      6 var worker = new Worker('./claim-nested-worker-fetch-parent-worker.js');
      7 
      8 function fetch_in_worker(url) {
      9  return new Promise((resolve) => {
     10    worker.onmessage = (event) => {
     11      resolve(event.data);
     12    };
     13    worker.postMessage(url);
     14  });
     15 }
     16 </script>