4 https://bugzilla.mozilla.org/show_bug.cgi?id=396851
7 <title>Test for Bug
396851</title>
8 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
9 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css"/>
11 <script type=
"text/javascript">
12 function throws(func
, pattern
, msg
) {
17 ok(pattern
.test(e
), `${msg}: Expect exception mathing ${pattern}`);
22 var iframe
= $("ifr");
23 var win
= iframe
.contentWindow
;
24 throws(() => win
.document
,
26 "Unprivileged code should not be able to access cross-origin document");
28 if (SpecialPowers
.useRemoteSubframes
) {
29 throws(() => win
.document
,
31 "Privileged code should not be able to access cross-process document");
33 ok(SpecialPowers
.wrap(win
).document
!= null,
34 "Able to access the cross-origin document");
41 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=396851">Mozilla Bug
396851</a>
43 <div id=
"content" style=
"display: none">
45 <script type=
"text/javascript">
46 SimpleTest
.waitForExplicitFinish();
49 src=
"http://example.org/tests/js/xpconnect/tests/mochitest/inner.html"