file_same_site_cookies_blob_iframe_navigation.html (1010B)
1 <html> 2 <body> 3 <iframe id="testframe"></iframe> 4 <script type="application/javascript"> 5 6 // simply passing on the message from the child to parent 7 window.addEventListener("message", receiveMessage); 8 function receiveMessage(event) { 9 window.removeEventListener("message", receiveMessage); 10 window.parent.postMessage({result: event.data.result}, '*'); 11 } 12 13 const NESTED_IFRAME_NAVIGATION = ` 14 <html> 15 <body> 16 <a id="testlink" href="http://mochi.test:8888/tests/dom/security/test/general/file_same_site_cookies_iframe.sjs"></a> 17 <script type="application/javascript"> 18 let link = document.getElementById("testlink"); 19 link.click(); 20 <\/script> 21 </body> 22 </html>`; 23 let NESTED_BLOB_IFRAME_NAVIGATION = new Blob([NESTED_IFRAME_NAVIGATION], {type:'text/html'}); 24 25 // query the testframe and set blob URL 26 let testframe = document.getElementById("testframe"); 27 testframe.src = window.URL.createObjectURL(NESTED_BLOB_IFRAME_NAVIGATION); 28 </script> 29 </body> 30 </html>