Source code
Revision control
Copy as Markdown
Other Tools
<!DOCTYPE html>
<h1>file_broadcast_load.html</h1>
<script>
let channel = new BroadcastChannel("test");
channel.onmessage = function(e) {
console.log("file_broadcast_load.html got message:", e.data);
if (e.data == "close") {
window.close();
}
};
addEventListener("load", function() {
console.log("file_broadcast_load.html loaded");
channel.postMessage("load");
});
</script>