tor-browser

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

file_frameNavigation_blankTarget.html (1306B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <!--
      4 Tests for Mixed Content Blocker - Opening link with _blank target in an https iframe.
      5 https://bugzilla.mozilla.org/show_bug.cgi?id=841850
      6 -->
      7 <head>
      8  <meta charset="utf-8">
      9  <title>Tests for Mixed Content Frame Navigation</title>
     10 </head>
     11 <body>
     12 <a href="http://example.com/tests/dom/security/test/mixedcontentblocker/file_frameNavigation_innermost.html?blankTarget" id="blankTarget" target="_blank" rel="opener">Go to http site</a>
     13 
     14 <script>
     15  var blankTarget = document.getElementById("blankTarget");
     16  blankTarget.click();
     17 
     18  var observer = {
     19    observe(subject, topic, data) {
     20     if (topic === "specialpowers-http-notify-request" &&
     21         data === "http://example.com/tests/dom/security/test/mixedcontentblocker/file_frameNavigation_innermost.html?blankTarget") {
     22        parent.parent.postMessage({"test": "blankTarget", "msg": "opened an http link with target=_blank from a secure page"}, "http://mochi.test:8888");
     23        SpecialPowers.removeObserver(observer, "specialpowers-http-notify-request");
     24      }
     25    }
     26  }
     27 
     28  // This is a special observer topic that is proxied from http-on-modify-request
     29  // in the parent process to inform us when a URI is loaded
     30  SpecialPowers.addObserver(observer, "specialpowers-http-notify-request");
     31 </script>
     32 </body>
     33 </html>