file_fragment_handling_during_load.html (997B)
1 <html> 2 <head> 3 <script> 4 function checkHaveLoadedNewDoc() { 5 let l = document.body.firstChild.contentWindow.location.href; 6 if (!l.endsWith("file_fragment_handling_during_load_frame2.sjs")) { 7 opener.ok(true, "Fine. We will check later."); 8 setTimeout(checkHaveLoadedNewDoc, 500); 9 return; 10 } 11 opener.ok(true, "Have loaded a new document."); 12 opener.finishTest(); 13 } 14 function test() { 15 // Test that executing back() before load has started doesn't interrupt 16 // the load. 17 var ifr = document.getElementsByTagName("iframe")[0]; 18 ifr.onload = checkHaveLoadedNewDoc; 19 ifr.contentWindow.location.hash = "b"; 20 ifr.contentWindow.location.href = "file_fragment_handling_during_load_frame2.sjs"; 21 history.back(); 22 } 23 </script> 24 </head> 25 <body onload="setTimeout(test, 0)"><iframe src="file_fragment_handling_during_load_frame1.html#a"></iframe> 26 </body> 27 </html>