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 // If the debuggee cannot be put into debug mode, throw.
3 // Run this test only if this compartment can't be put into debug mode.
4 var canEnable = true;
5 if (typeof setDebugMode === 'function') {
6 try {
7 setDebugMode(true);
8 } catch (exc) {
9 canEnable = false;
10 }
11 }
13 if (!canEnable) {
14 var g = newGlobal();
15 g.libdir = libdir;
16 g.eval("load(libdir + 'asserts.js');");
17 g.parent = this;
18 g.eval("assertThrowsInstanceOf(function () { new Debugger(parent); }, Error);");
19 }