gui.Window.open() returns 未定义

gui.Window.open() returns undefined

我有一个以闪屏启动的 NW 应用程序,然后在新 window 中打开主应用程序。代码大概是这样的:

var appWin = gui.Window.open("https://localhost:8080/", {
    "icon": "app_icon.png",
    "frame": true,
    "width": 1200,
    "height": 800,
    "position": "center",
    "resizable": true,
    "min_width": 400,
    "min_height": 200
 })

 appWin.on('loaded', function() {
    // hide the splash screen
 })

但是,appWin 始终是 undefined,即使新的 window 打开并显示正确的内容也是如此。

我使用的是 nw-builder 版本 0.13.4,但我也尝试过各种版本的 0.14.x、0.15.x 和 0.16.x ,同样的问题。

任何可行的解决方法的建议也是可以接受的。

// Open a new window.
nw.Window.open("https://localhost:8080/", {
    "icon": "app_icon.png",
    "frame": true,
    "width": 1200,
    "height": 800,
    "position": "center",
    "resizable": true,
    "min_width": 400,
    "min_height": 200
 }, function(win) {
       console.log('window opened'. win);
       win.on('loaded', function() {
            console.log('window created');
       }
});