Backed out changeset 713114c0331a (bug 1938707) by developer request CLOSED TREE
[gecko.git] / js / xpconnect / tests / mochitest / file_documentdomain.html
blob784ed269d041657114995dfa02aacad35279deed
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script type="application/javascript">
6 function setDomain(domain) {
7 document.domain = domain;
10 function tryToAccess(otherWin) {
11 try {
12 var text = otherWin.document.getElementById('foo').innerHTML;
13 return /Better Late/.exec(text);
14 } catch (e) { return false; }
17 var gRef = null;
18 function storeReference(otherWin) {
19 gRef = otherWin.document.getElementById('foo');
22 function tryToAccessStored() {
23 try {
24 return /Better Late/.exec(gRef.innerHTML);
25 } catch (e) { return false; }
28 function invokingFunctionThrowsSecurityException(name) {
29 try {
30 window[name]();
31 return false;
32 } catch (e) { return /insecure|denied/.test(e); }
36 </script>
37 </head>
38 <body>
39 <span id="foo">Better Late than Never</span>
40 </body>
41 </html>