blob: 6b3b4db84398d81df939789d42a6cae0fdc87f12 (
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">
<title>Focus already focused iframe</title>
<script>
let haveGottenFocus = false;
function gotFocus() {
if (haveGottenFocus) {
parent.postMessage("FAIL", "*");
} else {
haveGottenFocus = true;
parent.postMessage("focus", "*");
}
}
window.onload = function() {
document.getElementsByTagName("input")[0].focus();
}
</script>
<input onfocus="gotFocus();">
|