Source code

Revision control

Copy as Markdown

Other Tools

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>activeElement design-mode inner document</title>
</head>
<body>
<h1>Inner</h1>
<script>
let innerlog = "innerlog:";
document.designmode = "on";
window.onmessage = function(e) {
if (e.data == "focus") {
document.documentElement.focus();
} else if (e.data == "getlog") {
innerlog += "activeElement:" + document.activeElement.tagName + ",";
parent.postMessage(innerlog, "*");
}
};
window.onfocus = function() {
innerlog += "windowfocus,";
};
window.onblur = function() {
innerlog += "windowblur,";
};
</script>
</body>
</html>