tor-browser

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

sjs_slow-script-server.sjs (420B)


      1 "use strict";
      2 
      3 let timer;
      4 
      5 const DELAY_MS = 2000;
      6 function handleRequest(request, response) {
      7   response.processAsync();
      8   timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
      9   timer.init(
     10     () => {
     11       response.setHeader("Content-Type", "text/javascript", false);
     12       response.write("console.log('script loaded')\n");
     13       response.finish();
     14     },
     15     DELAY_MS,
     16     Ci.nsITimer.TYPE_ONE_SHOT
     17   );
     18 }