tor-browser

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

location_replace.html (666B)


      1 <!DOCTYPE HTML>
      2 <html>
      3  <head>
      4    <title>location_replace</title>
      5    <script src="/resources/testharness.js"></script>
      6    <script src="/resources/testharnessreport.js"></script>
      7  </head>
      8  <body>
      9    <div id="log"></div>
     10    <script>
     11    test(function () {
     12      var href = location.href;
     13      location.replace('#x');
     14 
     15      assert_equals((href + "#x"), location.href, "location href");
     16 
     17    }, "location replace");
     18 
     19    test(function () {
     20      var href = location.href;
     21      assert_throws_dom('SYNTAX_ERR', function() { location.replace("//"); });
     22      assert_equals(location.href, href);
     23    }, "URL that fails to parse");
     24    </script>
     25  </body>
     26 </html>