javascript - How i get the window object in node webkit after startup -


i want register events on window object after startup in node-webkits node-main file. if

window.alert("foo") 

at beginning window not defined. if wait few seconds it's working.

settimeout(function(){   window.alert("foo") },2000)  

is there event (maybe member of process) can listen to, notified window object available ?

yes, there loaded event emitted can hook into.

var gui = require('nw.gui'); var win = gui.window.get(); win.on('loaded', function() {     // stuff  }); 

Comments

Popular posts from this blog

javascript - Any ideas when Firefox is likely to implement lengthAdjust and textLength? -

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -