tor-browser

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

1548057.html (1275B)


      1 <!doctype html>
      2 <html class="reftest-wait">
      3 <body>
      4 <script>
      5  let parentDoc = `
      6    <!doctype html>
      7    <script>
      8    onload = function() {
      9      let observer = new ResizeObserver(_ => {
     10        let parentFrame = window.parent.document.querySelector("iframe");
     11        parentFrame.getBoundingClientRect();
     12        parentFrame.style.display = "none";
     13        parentFrame.getBoundingClientRect();
     14        parentFrame.srcdoc = ""; // Navigate ourselves away.
     15      });
     16 
     17      setTimeout(() => observer.observe(document.documentElement), 0);
     18    }
     19  </` + 'script>';
     20  let iframe = document.createElement("iframe");
     21  iframe.srcdoc = parentDoc;
     22  iframe.onload = function() {
     23    if (this.srcdoc !== "") // We're only interested on the second load.
     24      return;
     25    SpecialPowers.forceGC();
     26    SpecialPowers.forceCC();
     27    requestAnimationFrame(() => {
     28      requestAnimationFrame(() => {
     29        SpecialPowers.forceGC();
     30        SpecialPowers.forceCC();
     31        iframe.style.display = "";
     32        requestAnimationFrame(() => {
     33          requestAnimationFrame(() => {
     34            // If we haven't crashed by now, we should be fine.
     35            document.documentElement.className = "";
     36          })
     37        })
     38      })
     39    });
     40  };
     41  document.body.appendChild(iframe);
     42 </script>