blob: 88be6e0b04a99b8477925107e1f534024f021b5e [file] [log] [blame]
<!DOCTYPE html>
<input id="target" value="This should be focused!" autofocus></input>
<script>
let got_focus = false;
target.addEventListener("focus", () => got_focus = true);
window.addEventListener("load", () => {
parent.postMessage("grand_child_loaded", "*");
});
window.addEventListener("message", event => {
if (event.data == "report_focus_state") {
let msg = got_focus ? "grand_child_is_focused" : "grand_child_is_not_focused";
parent.postMessage(msg, "*");
}
});
</script>