onload_message.html (717B)
1 <html> 2 <head> 3 <meta charset="utf-8"> 4 <script> 5 addEventListener("load", function() { 6 // This file is used in couple of different tests. 7 if (opener) { 8 opener.postMessage("load", "*"); 9 } else { 10 var bc = new BroadcastChannel("browser_browsingContext"); 11 bc.onmessage = function(event) { 12 if (event.data == "back") { 13 bc.close(); 14 history.back(); 15 } 16 }; 17 bc.postMessage({event: "load", framesLength: frames.length }); 18 } 19 }); 20 </script> 21 </head> 22 <body> 23 This file posts a message containing "load" to opener or BroadcastChannel on load completion. 24 </body> 25 </html>