tor-browser

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

slow_ok_sheet.sjs (657B)


      1 // Make sure our timer stays alive.
      2 let gTimer;
      3 
      4 function handleRequest(request, response) {
      5   response.setHeader("Content-Type", "text/css", false);
      6   response.setStatusLine("1.1", 200, "OK");
      7   response.processAsync();
      8 
      9   gTimer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
     10   // Wait for 1s before responding; this should usually make sure this load comes in last.
     11   gTimer.init(
     12     () => {
     13       // This sheet _does_ still get applied even though its importing link
     14       // overall reports failure...
     15       response.write("nosuchelement { background: red }");
     16       response.finish();
     17     },
     18     1000,
     19     Ci.nsITimer.TYPE_ONE_SHOT
     20   );
     21 }