You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On Windows, a common (bad) window design pattern is to minimize the window to the notification area. e.g. Hide and window when you click the minimize button and add a tray icon to bring the window back.
To implement it in node-webkit, you can use the code bellow. But you should remember that this behaviour is not recommended in most times.
<html><body><div>Minimize to tray</div><script>// Load libraryvargui=require('nw.gui');// Reference to window and trayvarwin=gui.Window.get();vartray;// Get the minimize eventwin.on('minimize',function(){// Hide windowthis.hide();// Show traytray=newgui.Tray({icon: 'icon.png'});// Show window and remove tray when clickedtray.on('click',function(){win.show();this.remove();tray=null;});});</script></body></html>