js/xpconnect/tests/mochitest/file_documentdomain.html

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

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 <head>
     4 <script type="application/javascript">
     6   function setDomain(domain) {
     7     document.domain = domain;
     8   }
    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; }
    15   }
    17   var gRef = null;
    18   function storeReference(otherWin) {
    19     gRef = otherWin.document.getElementById('foo');
    20   }
    22   function tryToAccessStored() {
    23     try {
    24       return /Better Late/.exec(gRef.innerHTML);
    25     } catch (e) { return false; }
    26   }
    29 </script>
    30 </head>
    31 <body>
    32 <span id="foo">Better Late than Never</span>
    33 </body>
    34 </html>

mercurial