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 trying to execute parser-inserted non-executed scripts</title>
5 </head>
6 <body>
7 <div></div>
8 <script></script>
9 <script></script>
10 <script>
11 function log(text) {
12 var p = document.createElement("p");
13 p.appendChild(document.createTextNode(text));
14 document.getElementsByTagName("div")[0].appendChild(p);
15 }
17 var head = document.getElementsByTagName("head")[0];
19 var external = document.getElementsByTagName("script")[0];
20 external.src = "bug591981-script.js";
22 var internal = document.getElementsByTagName("script")[1];
23 var data = "log('internal')";
24 try {
25 internal.text = data;
26 } catch(e) {
27 internal.appendChild(document.createTextNode(data));
28 }
30 </script>
31 </body>
32 </html>