tor-browser

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

location-protocol-setter-non-broken-weird.html (1144B)


      1 <!doctype html>
      2 <title>Set location.protocol from an HTTP URL</title>
      3 <!-- In particular, valid non-broken schemes that are nevertheless not going to work -->
      4 <script src=/resources/testharness.js></script>
      5 <script src=/resources/testharnessreport.js></script>
      6 <div id=log></div>
      7 <iframe src=/common/blank.html></iframe>
      8 <iframe src=/common/blank.html></iframe>
      9 <iframe src=/common/blank.html></iframe>
     10 <iframe src=/common/blank.html></iframe>
     11 <iframe src=/common/blank.html></iframe>
     12 <iframe src=/common/blank.html></iframe>
     13 <script>
     14 self.onload = () => {
     15  [
     16    'x',
     17    'data',
     18    'file',
     19    'ftp',
     20    'http+x'
     21  ].forEach((val, index) => {
     22    async_test((t) => {
     23      self[index].location.protocol = val
     24      t.step_timeout(() => {
     25        assert_equals(self[index].location.protocol, location.protocol)
     26        assert_equals(self[index].location.host, location.host)
     27        assert_equals(self[index].location.port, location.port)
     28        t.done()
     29        // Experimentally, 4 seconds is long enough for the navigation to
     30        // complete, if it happens.
     31      }, 4000)
     32    }, "Set location.protocol to " + val)
     33  })
     34 }
     35 </script>