tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

test_setting_document.domain_to_shortened_ipaddr.html (1203B)


      1 <!DOCTYPE html>
      2 <html>
      3 <head>
      4  <title>document.domain can't be meaningfully set on pages at IP address hosts</title>
      5  <script src="/tests/SimpleTest/SimpleTest.js"></script>        
      6  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
      7 </head>
      8 <body>
      9 <p id="display"></p>
     10 <div id="content" style="display: none">
     11  
     12 </div>
     13 
     14 <iframe id="childframe" name="child"></iframe>
     15 
     16 <pre id="test">
     17 <script class="testbody" type="application/javascript">
     18 
     19 SimpleTest.waitForExplicitFinish();
     20 
     21 function receiveMessage(evt)
     22 {
     23  is(evt.origin, "http://127.0.0.1:8888", "wrong sender");
     24  ok(evt.source === window.frames.child, "wrong sender");
     25 
     26  is(evt.data, "child-response", "got wrong response");
     27 
     28  SimpleTest.finish();
     29 }
     30 window.addEventListener("message", receiveMessage);
     31 
     32 // By default, proxies don't apply to 127.0.0.1.
     33 // We need them to for this test (at least on android), though:
     34 SpecialPowers.pushPrefEnv({set: [
     35  ["network.proxy.allow_hijacking_localhost", true]
     36 ]}).then(function() {
     37  var iframe = document.getElementById("childframe");
     38  iframe.src = "http://127.0.0.1:8888/tests/dom/tests/mochitest/dom-level0/child_ip_address.html";
     39 });
     40 </script>
     41 </pre>
     42 </body>
     43 </html>