tor-browser

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

empty-sw.html (671B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <head>
      4  <meta charset="UTF-8">
      5  <title>Service worker test</title>
      6 </head>
      7 <body>
      8 <script type="text/javascript">
      9 "use strict";
     10 
     11 let registration;
     12 
     13 const registerServiceWorker = async function() {
     14  try {
     15    registration = await navigator.serviceWorker.register("empty-sw.worker.js");
     16    dump("Empty service worker registered\n");
     17  } catch (e) {
     18    dump("Empty service worker not registered: " + e + "\n");
     19  }
     20 };
     21 
     22 // Helper called from helper-serviceworker.js to unregister the service worker.
     23 window.getRegistration = function() {
     24  return registration;
     25 };
     26 // Register the service worker.
     27 registerServiceWorker();
     28 </script>
     29 </body>
     30 </html>