tor-browser

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

file_service_worker.html (509B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <head>
      4  <title>Bug 1208559 - ServiceWorker registration not governed by CSP</title>
      5 </head>
      6 <body>
      7 <script>
      8  function finish(status) {
      9    window.parent.postMessage({result: status}, "*");
     10  }
     11 
     12  const promises = [
     13    navigator.serviceWorker.ready,
     14    navigator.serviceWorker.register("file_service_worker.js", { scope: "." })
     15  ];
     16 
     17  Promise.race(promises).then(finish.bind(null, 'allowed'),
     18                              finish.bind(null, 'blocked'));
     19  </script>
     20 </body>
     21 </html>