blob: df7974e75bb9460d75a400bcee9657c9fc610d0d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
<!DOCTYPE html>
<body>
<script>
async function handleMessage(e) {
if (e.data == "focus" || e.data == "focus-update-active-element") {
let iframe = document.querySelector("iframe");
iframe.contentWindow.postMessage(e.data, "*");
}
}
if (window.portalHost)
window.portalHost.onmessage = handleMessage;
window.onportalactivate = e => {
var portal = e.adoptPredecessor();
document.body.appendChild(portal);
portal.onmessage = handleMessage;
}
window.onmessage = e => {
if (window.portalHost)
window.portalHost.postMessage(e.data);
else
document.querySelector("portal").postMessage(e.data);
}
</script>
<iframe src="http://{{hosts[alt][www]}}:{{ports[http][0]}}/portals/resources/focus-page-with-button.html"></iframe>
</body>
|