Thu, 15 Jan 2015 15:59:08 +0100
Implement a real Private Browsing Mode condition by changing the API/ABI;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.
1 // Frame.script/offset and Script.getOffsetLine work in non-top frames.
3 var g = newGlobal();
4 var dbg = Debugger(g);
5 var hits = 0;
6 dbg.onDebuggerStatement = function (frame) {
7 var a = [];
8 for (; frame.type == "call"; frame = frame.older)
9 a.push(frame.script.getOffsetLine(frame.offset) - g.line0);
10 assertEq(a.join(","), "1,2,3,4");
11 hits++;
12 };
13 g.eval("var line0 = Error().lineNumber;\n" +
14 "function f0() { debugger; }\n" +
15 "function f1() { f0(); }\n" +
16 "function f2() { f1(); }\n" +
17 "function f3() { f2(); }\n" +
18 "f3();\n");
19 assertEq(hits, 1);