blob: e402b0693f6cacb4494f72470428ee9f2e972e33 [file] [log] [blame]
<!DOCTYPE html>
<div>This frame should not be focused!</div>
<script>
let got_focus = false;
window.addEventListener("focus", () => {
got_focus = true;
});
window.addEventListener("load", () => {
parent.postMessage("child_loaded", "*");
});
window.addEventListener("message", event => {
if (event.data == "attempt_to_focus") {
window.focus();
let msg = got_focus ? "child_is_focused" : "child_is_not_focused";
parent.postMessage(msg, "*");
}
});
</script>