tor-browser

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

location-protocol-setter-sameish.html (809B)


      1 <!doctype html>
      2 <title>Set location.protocol to the scheme it already was</title>
      3 <script src=/resources/testharness.js></script>
      4 <script src=/resources/testharnessreport.js></script>
      5 <div id=log></div>
      6 <iframe src=/common/blank.html></iframe>
      7 <iframe src=/common/blank.html></iframe>
      8 <iframe src=/common/blank.html></iframe>
      9 <iframe src=/common/blank.html></iframe>
     10 <script>
     11 self.onload = () => {
     12  [
     13    "http",
     14    "ht\x0Atp",
     15    "http\x0A",
     16    "\x09ht\x09\x0AtP"
     17  ].forEach((val, index) => {
     18    async_test(t => {
     19      self[index].frameElement.onload = t.step_func_done(() => {
     20        assert_equals(self[index].location.protocol, "http:");
     21      });
     22      self[index].location.protocol = val;
     23    }, `Set location.protocol to ${encodeURI(val)} (percent-encoded here for clarity)`);
     24  });
     25 }
     26 </script>