010-5.html (807B)
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-4.html?2345'); 13 parent.test(function () { 14 parent.assert_equals( httpReferer, lastUrl ); 15 }, 'HTTP Referer should use the replaced state (before onload)'); 16 parent.test(function () { 17 parent.assert_equals( document.referrer, lastUrl ); 18 }, 'document.referrer should use the replaced state (before onload)'); 19 parent.done(); 20 </script> 21 22 </body> 23 </html>