tor-browser

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

011.html (967B)


      1 <!doctype html>
      2 <html>
      3  <head>
      4    <title>history.pushState before onload</title>
      5    <script type="text/javascript" src="/resources/testharness.js"></script>
      6    <script type="text/javascript" src="/resources/testharnessreport.js"></script>
      7  </head>
      8  <body>
      9 
     10    <noscript><p>Enable JavaScript and reload</p></noscript>
     11    <div id="log"></div>
     12    <script type="text/javascript">
     13 var newUrl = location.href.replace(/\/[^\/]*$/,'\/011-1.html');
     14 setup({explicit_done:true});
     15 test(function () {
     16  history.pushState('','','011-1.html');
     17 }, 'pushState should be able to set the location state');
     18 test(function () {
     19  assert_equals( location.href, newUrl );
     20 }, 'pushed location should be reflected immediately');
     21 window.onload = function () {
     22  setTimeout(function () {
     23    test(function () {
     24      assert_equals( location.href, newUrl );
     25    }, 'pushed location should be retained after the page has loaded');
     26    done();
     27  },10);
     28 };
     29    </script>
     30 
     31  </body>
     32 </html>