blob: 3a4419105aaea3caac5f730d0db98d260e3590c6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
<!DOCTYPE html>
<meta charset="utf-8">
Popup <input id="input">
<script>
window.onload = async () => {
try {
if (!document.hasFocus()) {
const input = document.getElementById("input");
input.focus();
await new Promise(r => input.onfocus = r);
}
opener.postMessage(`focus = ${document.hasFocus()}`, "*");
} catch(e) {
opener.postMessage(`${e.name}: $(e.message)`, "*");
}
};
</script>
</html>
|