tor-browser

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

script-1_bug597345.sjs (633B)


      1 // timer has to be alive so it can't be eaten by the GC.
      2 var timer;
      3 
      4 function handleRequest(request, response) {
      5   response.setHeader("Cache-Control", "no-cache", false);
      6   response.setHeader("Content-Type", "text/javascript", false);
      7   // The "stray" open comment at the end of the write is important!
      8   response.write(
      9     "document.write(\"<script charset='utf-8' src='script-2_bug597345.js'></script><!--\")"
     10   );
     11   response.processAsync();
     12   timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
     13   timer.initWithCallback(
     14     function () {
     15       response.finish();
     16     },
     17     200,
     18     Ci.nsITimer.TYPE_ONE_SHOT
     19   );
     20 }