Last active
June 18, 2018 17:35
-
-
Save nolanlawson/164ddb177247d0963a7a5e21554e5e58 to your computer and use it in GitHub Desktop.
Test window.focus() on child window
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Test window.open focus</title> | |
<style> | |
body { | |
max-width: 600px; | |
margin: 20px auto; | |
} | |
</style> | |
</head> | |
<body> | |
<h1>Test window.open focus</h1> | |
<button type="button" onclick="window.__window = window.open('window.html');">Open window</button> | |
<button type="button" onclick="window.__window.focus()">Focus window</button> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Test window.open focus</title> | |
<style> | |
body { | |
max-width: 600px; | |
margin: 20px auto; | |
} | |
</style> | |
</head> | |
<body> | |
<h1>Test window.open focus</h1> | |
<p>Switch back to the other tab and click "focus window"</p> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment