chromium/third_party/blink/web_tests/external/wpt/html/interaction/focus/document-level-focus-apis/support/popup.html

<!DOCTYPE html>
<meta charset="utf-8">
Popup <input id="input">
<script>
window.onload = async () => {
  try {
    if (!document.hasFocus()) {
      const input = document.getElementById("input");
      input.focus();
      await new Promise(r => input.onfocus = r);
    }
    opener.postMessage(`focus = ${document.hasFocus()}`, "*");
  } catch(e) {
    opener.postMessage(`${e.name}: $(e.message)`, "*");
  }
};
</script>
</html>