tor-browser

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

keepalive-worker.js (435B)


      1 /**
      2 * Script that sends keepalive
      3 * fetch request and terminates immediately.
      4 * The request URL is passed as a parameter to this worker
      5 */
      6 function sendFetchRequest() {
      7    // Parse the query parameter from the worker's script URL
      8    const urlString = self.location.search.replace("?param=", "");
      9    postMessage('started');
     10    fetch(`${urlString}`, { keepalive: true });
     11 }
     12 
     13 sendFetchRequest();
     14 // Terminate the worker
     15 self.close();