content/base/test/file_mixed_content_frameNavigation_blankTarget.html

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:fe961c406ba3
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>
13
14 <script>
15 var blankTarget = document.getElementById("blankTarget");
16 blankTarget.click();
17
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);
29
30 </script>
31 </body>
32 </html>

mercurial