Node-Webkit - Starting Maximized

 ̄綄美尐妖づ 提交于 2019-12-03 23:25:47

I don't think the manifest has an option to do that. Instead, call nw's Window.maximize() on startup. Something like:

// Load native UI library
var ngui = require('nw.gui');

// Get the current window
var nwin = ngui.Window.get();

Sometime later, in onload or some other point where you're ready to show the window:

onload = function() {
    nwin.show();
    nwin.maximize();
}

This is described in the node-webkit wiki. I don't think you can call maximize before showing the main window though (if it's hidden in manifest), but I haven't really dug into it.

You may want to consider saving the window position, from a UX standpoint. The wiki has an example for doing this.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!