Tue, 06 Jan 2015 21:39:09 +0100
Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.
1 var timer;
3 function handleRequest(request, response)
4 {
5 response.setHeader("Cache-Control", "no-cache, must-revalidate", false);
6 response.setHeader("Content-Type", "text/css", false);
7 response.write("body { background:lime; color:red; }");
8 response.processAsync();
9 timer = Components.classes["@mozilla.org/timer;1"]
10 .createInstance(Components.interfaces.nsITimer);
11 timer.initWithCallback(function() {
12 response.finish();
13 }, 500, Components.interfaces.nsITimer.TYPE_ONE_SHOT);
14 }