consumption-crossorigin-child.sub.html (970B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <script> 5 window.top.postMessage(JSON.stringify({ 6 "type": "child-crossorigin-loaded", 7 "isActive": navigator.userActivation.isActive, 8 "hasBeenActive": navigator.userActivation.hasBeenActive 9 }), "*"); 10 11 window.addEventListener("click", event => { 12 window.open().close(); 13 14 window.top.postMessage(JSON.stringify({ 15 "type": "child-crossorigin-report", 16 "isActive": navigator.userActivation.isActive, 17 "hasBeenActive": navigator.userActivation.hasBeenActive 18 }), "*"); 19 }); 20 </script> 21 </head> 22 <body style="background: lightgreen;"> 23 <!-- The midpoint of this frame should be outside the grandchild frame. --> 24 <div style="height: 75px;">Cross-origin child frame</div> 25 <iframe id="child2" width="270px" height="30px" 26 src="http://{{hosts[][]}}:{{ports[http][1]}}/html/user-activation/resources/child-two.html"> 27 </iframe> 28 </body> 29 </html>