Created
April 3, 2013 05:40
-
-
Save oklai/5298706 to your computer and use it in GitHub Desktop.
How to not auto focus of the "always-on-top" 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> | |
<head> | |
<meta charset="UTF-8"> | |
<title>How to not auto focus of the "always-on-top" window.</title> | |
</head> | |
<body> | |
test html | |
<script type="text/javascript"> | |
setTimeout(function () { | |
var win = require('nw.gui').Window.open("http://www.google.com", {show: false}); | |
//why not user "loaded" event, sometime it doesn't work. | |
setTimeout(function () { | |
console.log('blur'); | |
win.show(); | |
win.blur(); | |
//or blur first, show behind | |
}, 3000); | |
}, 3000); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment