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 <!DOCTYPE html>
2 <html>
3 <head>
4 <script type="application/javascript">
6 function setDomain(domain) {
7 document.domain = domain;
8 }
10 function tryToAccess(otherWin) {
11 try {
12 var text = otherWin.document.getElementById('foo').innerHTML;
13 return /Better Late/.exec(text);
14 } catch (e) { return false; }
15 }
17 var gRef = null;
18 function storeReference(otherWin) {
19 gRef = otherWin.document.getElementById('foo');
20 }
22 function tryToAccessStored() {
23 try {
24 return /Better Late/.exec(gRef.innerHTML);
25 } catch (e) { return false; }
26 }
29 </script>
30 </head>
31 <body>
32 <span id="foo">Better Late than Never</span>
33 </body>
34 </html>