tor-browser

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

mutation-observer-iframe-script.html (616B)


      1 <!doctype html>
      2 <script>
      3 window.scriptRan = false;
      4 
      5 new MutationObserver((mutations, observer) => {
      6  mutations.forEach(({ addedNodes }) => {
      7    addedNodes.forEach(node => {
      8      if (node.nodeType == 1 && node.tagName == "SCRIPT") {
      9        document.write("document.write body contents\n");
     10        document.close();
     11        window.parent.document.dispatchEvent(new CustomEvent("documentWriteDone"));
     12      }
     13    });
     14  });
     15 }).observe(document.documentElement, { childList: true, subtree: true });
     16 </script>
     17 Initial body contents
     18 <script>window.parent.document.dispatchEvent(new CustomEvent("scriptRan"));</script>