tor-browser

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

update-claim-worker.py (661B)


      1 import time
      2 
      3 script = u'''
      4 // Time stamp: %s
      5 // (This ensures the source text is *not* a byte-for-byte match with any
      6 // previously-fetched version of this script.)
      7 
      8 // This no-op fetch handler is necessary to bypass explicitly the no fetch
      9 // handler optimization by which this service worker script can be skipped.
     10 addEventListener('fetch', event => {
     11    return;
     12  });
     13 
     14 addEventListener('install', event => {
     15    event.waitUntil(self.skipWaiting());
     16  });
     17 
     18 addEventListener('activate', event => {
     19    event.waitUntil(self.clients.claim());
     20  });'''
     21 
     22 
     23 def main(request, response):
     24  return [(b'Content-Type', b'application/javascript')], script % time.time()