cross-origin-middle-frame-2.html (852B)
1 <!DOCTYPE html> 2 <!-- This document is used for the test `move-node-local-root-events-still-fire.html` --> 3 <script src="/common/get-host-info.sub.js"></script> 4 5 <body> 6 <script> 7 (async function() { 8 // This iframe will be cross-origin to the current document, but same-origin 9 // with its grandparent, our direct parent. 10 const iframe = document.createElement('iframe'); 11 // A URL that's cross-origin to this document, and same-origin to our parent. 12 const crossOriginChildURL = new URL('create-button-with-pointerdown-listener.html', location.href).toString().replace(location.origin, get_host_info().HTTP_ORIGIN); 13 iframe.src = crossOriginChildURL; 14 const loadPromise = new Promise(resolve => iframe.onload = resolve); 15 document.body.append(iframe); 16 await loadPromise; 17 18 parent.postMessage('grandchild loaded', '*'); 19 })(); 20 </script> 21 </body>