tor-browser

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

sw.js (405B)


      1 // The source to post setup and completion results to.
      2 let source = null;
      3 
      4 function sendMessageToDocument(msg) {
      5  source.postMessage(msg);
      6 }
      7 
      8 // Notify the document that the SW is registered and ready.
      9 self.addEventListener('message', event => {
     10  source = event.source;
     11  sendMessageToDocument('ready');
     12 });
     13 
     14 self.addEventListener('sync', event => {
     15  sendMessageToDocument('sync event received!');
     16 });