tor-browser

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

010-3.html (894B)


      1 <!doctype html>
      2 <html>
      3        <head>
      4                <title>history.pushState/replaceState and referer headers (before onload)</title>
      5        </head>
      6        <body>
      7 
      8                <noscript><p>Enable JavaScript and reload</p></noscript>
      9                <div id="log"></div>
     10                <script type="text/javascript">
     11   var httpReferer = "{{headers[referer]}}";
     12 var lastUrl = location.href.replace(/\/[^\/]*$/,'\/010-2.html?1234');
     13 parent.test(function () {
     14        parent.assert_equals( httpReferer, lastUrl );
     15 }, 'HTTP Referer should use the pushed state (before onload)');
     16 parent.test(function () {
     17        parent.assert_equals( document.referrer, lastUrl );
     18 }, 'document.referrer should use the pushed state (before onload)');
     19 try { history.pushState('','','010-4.html?2345'); } catch(e) {}
     20 location.href = '010-5.html?pipe=sub';
     21                </script>
     22 
     23        </body>
     24 </html>