window-sw-shared-name.html (503B)
1 <!DOCTYPE html> 2 <title>Window for cross-origin iframe with Shared Worker</title> 3 <script src="/common/get-host-info.sub.js"></script> 4 5 <body> 6 <script> 7 8 const iframe_url = new URL( 9 'iframe-sw-shared-name.html', 10 get_host_info().ORIGIN + self.location.pathname); 11 12 13 window.onmessage = (e) => {window.opener.postMessage(e.data, '*')}; 14 15 var frame = document.createElement('iframe'); 16 frame.src = iframe_url; 17 frame.style.position = 'absolute'; 18 document.body.appendChild(frame); 19 20 </script> 21 </body> 22 </html>