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", false);
6 response.setHeader("Content-Type", "text/plain", false);
7 response.write("Responded");
8 response.processAsync();
9 timer = Components.classes["@mozilla.org/timer;1"]
10 .createInstance(Components.interfaces.nsITimer);
11 timer.initWithCallback(function() {
12 response.finish();
13 // 50ms certainly be enough for one refresh driver firing to happen!
14 }, 50, Components.interfaces.nsITimer.TYPE_ONE_SHOT);
15 }