Source code
Revision control
Copy as Markdown
Other Tools
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>focus() before iframe loaded same site</title>
</head>
<body>
<script>
window.onload = function() {
parent.postMessage("onload", "*");
}
document.body.onfocus = function() {
parent.postMessage("onfocus", "*");
}
</script>
</body>
</html>