file_new_shentry_during_history_navigation_3.html (668B)
1 <script> 2 window.onpageshow = function(e) { 3 if (location.search == "?v2") { 4 onbeforeunload = function() { 5 history.pushState("data1", "", "?push1"); 6 } 7 } 8 9 let bc = new BroadcastChannel("new_shentry_during_history_navigation"); 10 bc.onmessage = function(event) { 11 bc.close(); 12 if (event.data == "loadnext") { 13 location.href = "file_new_shentry_during_history_navigation_4.html"; 14 } else if (event.data == "back") { 15 history.back(); 16 } else if (event.data == "close") { 17 window.close(); 18 } 19 } 20 bc.postMessage({page: location.href, type: e.type, persisted: e.persisted}); 21 } 22 </script>