content/base/test/file_bug557892.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 <html><head>
     2 <title>Crash [@ nsGenericElement::SetAttr] with classList.toggle</title>
     3 <script>
     4 var classList;
     5 var interval;
     6 function run() {
     7   classList = window.frames[0].document.documentElement.classList;
     8   window.frames[0].location.reload();
     9   interval = setInterval(function(aClassList) {aClassList.toggle('a'); forcegc();}, 10, classList);
    10   // Let the interval run for awhile and close the window after 2 seconds.
    11   setTimeout(function() { clearInterval(interval); window.opener.done(); window.close(); }, 2000);
    12 }
    14 function forcegc(){
    15   SpecialPowers.forceGC();
    16   SpecialPowers.gc();
    17 }
    19     </script>
    20   </head>
    21   <body onload="run()">
    22     <iframe></iframe>
    23   </body>
    24 </html>

mercurial