tor-browser

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

controlled-install.html (598B)


      1 <!-- Any copyright is dedicated to the Public Domain.
      2     http://creativecommons.org/publicdomain/zero/1.0/ -->
      3 <!DOCTYPE HTML>
      4 <html>
      5 <head>
      6  <meta charset="UTF-8">
      7  <title>Service worker test</title>
      8 </head>
      9 <body>
     10 <script type="text/javascript">
     11 "use strict";
     12 
     13 let registration;
     14 
     15 window.registerServiceWorker = async function() {
     16  registration = await navigator.serviceWorker.register(
     17    "controlled-install-sw.js"
     18  );
     19  window.sw = registration;
     20 };
     21 
     22 window.installServiceWorker = function() {
     23  registration.installing.postMessage("install-service-worker");
     24 };
     25 </script>
     26 </body>
     27 </html>