blob: d160fb2a252c30e9af16a40b57a0bdb1a4b73e08 [file] [log] [blame]
<!DOCTYPE html>
<body>
<script>
var portal = document.createElement("portal");
portal.src = "portal-post-message-portal.html";
document.body.appendChild(portal);
var bc = new BroadcastChannel("portals-post-message");
bc.onmessage = () => {
bc.close();
portal.activate().then(() => {
error = "";
try {
portal.postMessage("message");
}
catch(err) {
error = err.name;
}
bc = new BroadcastChannel("portals-post-message-after-activate");
bc.postMessage(error);
bc.close();
});
}
</script>
</body>