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 obj;
2 var counter = 0;
3 var p = Proxy.create({
4 has : function(id) {
5 if (id == 'xyz') {
6 ++counter;
7 if (counter == 7) {
8 obj.__proto__ = null;
9 }
10 return true;
11 }
12 return false;
13 },
14 get : function(id) {
15 if (id == 'xyz')
16 return 10;
17 }
18 });
20 function test()
21 {
22 Object.prototype.__proto__ = null;
23 obj = { xyz: 1};
24 var n = 0;
25 for (var i = 0; i != 100; ++i) {
26 var s = obj.xyz;
27 if (s)
28 ++n;
29 if (i == 10) {
30 delete obj.xyz;
31 Object.prototype.__proto__ = p;
32 }
34 }
35 }
37 try {
38 test();
39 } catch (e) {}