Sat, 03 Jan 2015 20:18:00 +0100
Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.
1 var timer = null; // declare timer outside to prevent premature GC
2 function handleRequest(request, response)
3 {
4 response.processAsync();
5 response.setHeader("Content-Type", "text/plain", false);
7 for (var i = 0; i < 1000; ++i)
8 response.write("Hello... ");
10 timer = Components.classes["@mozilla.org/timer;1"]
11 .createInstance(Components.interfaces.nsITimer);
12 timer.initWithCallback(function() {
13 response.write("world.\n");
14 response.finish();
15 }, 10 * 1000 /* 10 secs */, Components.interfaces.nsITimer.TYPE_ONE_SHOT);
16 }