content/test/reftest/bug591981-2.html

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     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>

mercurial