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 <title>Script-inserted script</title>
5 </head>
6 <body>
7 <div></div>
8 <script>
9 function log(text) {
10 var p = document.createElement("p");
11 p.appendChild(document.createTextNode(text));
12 document.getElementsByTagName("div")[0].appendChild(p);
13 }
15 var head = document.getElementsByTagName("head")[0];
17 var external = document.createElement("script");
18 external.src = "bug591981-script.js";
19 head.insertBefore(external, head.firstChild); // what jQuery does
21 var internal = document.createElement("script");
22 var data = "log('internal')";
23 try {
24 internal.text = data;
25 } catch(e) {
26 internal.appendChild(document.createTextNode(data));
27 }
28 head.insertBefore(internal, head.firstChild); // what jQuery does
30 </script>
31 </body>
32 </html>