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 // The script and environment of a non-debuggee frame are inaccessible.
3 load(libdir + 'asserts.js');
5 var g = newGlobal();
6 var dbg = new Debugger;
8 var log;
9 dbg.onDebuggerStatement = function (frame) {
10 log += frame.type;
11 // Initially, 'frame' is a debuggee frame, and we should be able to see its script and environment.
12 assertEq(frame.script instanceof Debugger.Script, true);
13 assertEq(frame.environment instanceof Debugger.Environment, true);
15 // If we make g no longer a debuggee, then trying to touch the frame at
16 // all show throw.
17 dbg.removeDebuggee(g);
18 assertThrowsInstanceOf(() => frame.script, Error);
19 assertThrowsInstanceOf(() => frame.environment, Error);
20 }
22 g.eval('function f() { debugger; }');
24 log = '';
25 dbg.addDebuggee(g);
26 g.f();
27 assertEq(log, 'call');
29 log = '';
30 dbg.addDebuggee(g);
31 g.eval('debugger;');
32 assertEq(log, 'eval');