Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 <!DOCTYPE HTML>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=753278
5 -->
6 <head>
7 <meta charset="utf-8">
8 <title>Test for Bug 753278</title>
9 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
11 </head>
12 <body onload="runTest();">
13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=753278">Mozilla Bug 753278</a>
14 <p id="display"></p>
15 <div id="content" style="display: none">
16 <iframe></iframe>
17 </div>
18 <pre id="test">
19 <script type="application/javascript">
21 /** Test for Bug 753278 **/
23 SimpleTest.waitForExplicitFinish();
25 var f = document.getElementsByTagName("iframe")[0];
27 function runTest() {
28 f.contentDocument.open();
29 f.contentDocument.write('<script>window.location = "data:text/html;charset=utf-8,\\u003Cscript>parent.pass();\\u003C/script>"; document.close(); document.open(); document.write("\\u003Cscript>parent.fail();\\u003C/script>"); document.close();\u003c/script>');
30 f.contentDocument.close();
31 }
33 function pass() {
34 ok(true, "window.location took precedence");
35 SimpleTest.finish();
36 }
38 function fail() {
39 ok(false, "window.location should have taken precedence");
40 SimpleTest.finish();
41 }
43 </script>
44 </pre>
45 </body>
46 </html>