content/base/test/file_mixed_content_frameNavigation_blankTarget.html

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     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/content/base/test/file_mixed_content_frameNavigation_innermost.html?blankTarget" id="blankTarget" target="_blank">Go to http site</a>
    14 <script>
    15   var blankTarget = document.getElementById("blankTarget");
    16   blankTarget.click();
    18   var os = SpecialPowers.Cc["@mozilla.org/observer-service;1"].
    19      getService(SpecialPowers.Components.interfaces.nsIObserverService);
    20   var observer = {
    21     observe: function(subject, topic, data) {
    22       if(topic == "content-document-global-created" && data =="http://example.com") {
    23          parent.parent.postMessage({"test": "blankTarget", "msg": "opened an http link with target=_blank from a secure page"}, "http://mochi.test:8888");
    24          os.removeObserver(observer, "content-document-global-created");
    25       }
    26     }
    27   }
    28   os.addObserver(observer, "content-document-global-created", false);
    30 </script>
    31 </body>
    32 </html>

mercurial