tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

doc_force_gc.html (705B)


      1 <!-- Any copyright is dedicated to the Public Domain.
      2     http://creativecommons.org/publicdomain/zero/1.0/ -->
      3 <!doctype html>
      4 
      5 <html>
      6  <head>
      7    <meta charset="utf-8"/>
      8    <title>Performance tool + garbage collection test page</title>
      9  </head>
     10 
     11  <body>
     12    <script type="text/javascript">
     13    "use strict";
     14 
     15    var x = 1;
     16    /* global test */
     17    window.test = function() {
     18      SpecialPowers.Cu.forceGC();
     19      document.body.style.borderTop = x + "px solid red";
     20      x = 1 ^ x;
     21      // flush pending reflows
     22      document.body.innerHeight;
     23 
     24      // Prevent this script from being garbage collected.
     25      setTimeout(window.test, 100);
     26    };
     27    test();
     28    </script>
     29  </body>
     30 
     31 </html>