window object return in Window.open callback is undefined

Hello,

I’m upgrading my app from 0.12.3 to the latest nwjs version 0.27.5 I changed my code of window opening from:

var eWin:any = nw.Window.open(url, {
                "inject-js-start": scriptPath,
                "inject-js-end": scriptPath2,
                "show": false
         });

to:


nw.Window.open(url, {
                "inject_js_start": scriptPath,
                "inject_js_end": srciptPath2,
                "show": false
            }, (eWin: any) => {
                   if(!eWin) return;
            })

url is a remote site url and scriptPath, scriptPath2 are paths to local js files.
eWin retrun in callback is undefined, and this warning is shown on the devTools console:

Creating sandboxed window, it doesn’t have access to the chrome.app API. The chrome.app.window.create callback will be called, but there will be no object provided for the sandboxed window.

My OS is Mac OS High Sierra, I’m having same issue on windows 10.

Author: Fantashit

1 thought on “window object return in Window.open callback is undefined

Comments are closed.