content/test/reftest/bug591981-2.html

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

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.

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

mercurial