top-navigating-page.html (388B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>Page that navigates its top</title> 4 <script src=/common/get-host-info.sub.js></script> 5 <script> 6 7 let path = new URL("page-that-post-message-to-opener.html", window.location).pathname; 8 let fullUrl = get_host_info().HTTP_NOTSAMESITE_ORIGIN + path; 9 try { 10 top.location = fullUrl; 11 } catch { 12 top.opener.postMessage('Denied', '*'); 13 } 14 15 </script>