tor-browser

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

test_bug1632975.html (1411B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <!--
      4 https://bugzilla.mozilla.org/show_bug.cgi?id=1632975
      5 -->
      6 <head>
      7  <title>Test for Bug 1632975</title>
      8  <script src="/tests/SimpleTest/SimpleTest.js"></script>
      9  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
     10 </head>
     11 <body>
     12 <script class="testbody" type="text/javascript">
     13 SimpleTest.waitForExplicitFinish();
     14 
     15 function observeTest(mutationsList) {
     16  for (let mutation of mutationsList) {
     17    for (let node of mutation.addedNodes) {
     18      if (node.nodeName.toLowerCase() == "script") {
     19        node.setAttribute("type", "text/zpconsent")
     20      }
     21    }
     22  }
     23 }
     24 
     25 const observer = new MutationObserver(observeTest);
     26 observer.observe(document.body, { childList: true, subtree: true });
     27 
     28 let script2Ran = false;
     29 let script3Ran = false;
     30 script4Ran = false;
     31 
     32 onload = () => {
     33  ok(!script2Ran, "script2 should not have run");
     34  ok(!script3Ran, "script3 should not have run");
     35  ok(!script4Ran, "script4 should not have run");
     36  SimpleTest.finish();
     37 }
     38 </script>
     39 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1632975">Mozilla Bug 1632975</a>
     40 <p id="display"></p>
     41 <div id="content" style="display: none">
     42  <script id="script2">
     43    script2Ran = true;
     44  </script>
     45 
     46  <script id="script3" type="disabled">
     47    script3Ran = true;
     48  </script>
     49 
     50  <script id="script4" src="data:text/javascript,script4Ran = true;"></script>
     51 </div>
     52 </body>
     53 </html>