tor-browser

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

remove-script-element.https.html (785B)


      1 <!DOCTYPE html>
      2 <script src="/resources/testharness.js"></script>
      3 <script src="/resources/testharnessreport.js"></script>
      4 <script src="/common/utils.js"></script>
      5 <script src="../resources/utils.js"></script>
      6 <script src="resources/utils.js"></script>
      7 
      8 <body>
      9 <iframe id="iframe"></iframe>
     10 <script>
     11 setup(() => assertSpeculationRulesIsSupported());
     12 
     13 async_test(t => {
     14  const doc = iframe.contentDocument;
     15  const script = doc.createElement('script');
     16  script.type = 'speculationrules';
     17  script.text = `{"prerender": [{"source": "list", "urls": [] }] }`;
     18  doc.head.appendChild(script);
     19  iframe.remove();
     20  t.step_timeout(() => {
     21    document.head.appendChild(script);
     22    t.done();
     23  }, 0);
     24 }, 'Removing speculationrules script from detached document should not crash');
     25 </script>