Thu, 15 Jan 2015 15:59:08 +0100
Implement a real Private Browsing Mode condition by changing the API/ABI;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.
1 var timer = null; // Declare outside to prevent premature GC
3 function handleRequest(request, response)
4 {
5 response.setHeader("Cache-Control", "no-cache", false);
6 response.setHeader("Content-Type", "text/javascript", false);
7 response.write("var i = 0;");
8 response.bodyOutputStream.flush();
9 response.processAsync();
10 timer = Components.classes["@mozilla.org/timer;1"]
11 .createInstance(Components.interfaces.nsITimer);
12 timer.initWithCallback(function() {
13 response.finish();
14 }, 500, Components.interfaces.nsITimer.TYPE_ONE_SHOT);
15 }