tor-browser

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

example_check_and_unregister.html (493B)


      1 <!DOCTYPE html>
      2 <script>
      3  function done(exists) {
      4    parent.postMessage(exists, '*');
      5  }
      6 
      7  function fail() {
      8    parent.postMessage("FAIL", '*');
      9  }
     10 
     11  navigator.serviceWorker.getRegistration(".").then(function(reg) {
     12    if (reg) {
     13      reg.unregister().then(done.bind(undefined, true), fail);
     14    } else {
     15      dump("getRegistration() returned undefined registration\n");
     16      done(false);
     17    }
     18  }, function(e) {
     19    dump("getRegistration() failed\n");
     20    fail();
     21  });
     22 </script>