outbound-before-render.html (847B)
1 <!DOCTYPE html> 2 <head> 3 <style> 4 @view-transition { 5 navigation: auto; 6 } 7 </style> 8 <script id="blocker" async src="common.js?pipe=trickle(d10)" blocking="render"></script> 9 <script src="/resources/testharness.js"></script> 10 <script> 11 const params = new URLSearchParams(location.search); 12 const bc_channel = new BroadcastChannel(params.get("channel")); 13 14 window.addEventListener("pagereveal", e => { 15 if (params.get("phase") === "old") { 16 bc_channel.postMessage(`did reveal old page`); 17 } else { 18 bc_channel.postMessage(`did reveal new page ${e.viewTransition ? "with" : "without"} transition`); 19 } 20 }); 21 22 if (params.get("phase") === "new") { 23 document.getElementById("blocker").remove(); 24 } else { 25 step_timeout(() => { 26 location.href = `?phase=new&channel=${bc_channel.name}`; 27 }, 100); 28 } 29 </script> 30 </head> 31 32 <body> 33 Content 34 </body>