window object return in Window.open callback is undefined
See original GitHub issueHello,
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.
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
javascript - window.open returns undefined in chrome extension
Launch the window from the background page using window.open() . This returns a window object which has a reliable closed property. See the...
Read more >How to solve "window is not defined" errors in React and Next.js
Because in the Node.js world, window is not defined, window is only available in browsers. There are three ways to solve that: 1....
Read more >JS Window Object - JavaScript - Tech Altum Tutorial
JS Window Methods or build in functions. Window Methods. Method, Use. window.open(), Open a new browser window. For exp
Read more >Arrow function expressions - JavaScript - MDN Web Docs
(or the global object) return this.a + 10; // represents global object 'Window', therefore 'this.a' returns 'undefined' }, });
Read more >JavaScript Window open method - javatpoint
JavaScript Window open method with javascript tutorial, introduction, javascript oops, application of javascript, loop, variable, objects, map, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Try http://arxiv.org, got undefined:
Try https://scholar.google.com/, it returned the window object:
@rogerwang , could you please help check this issue?
@james-pellow it’s in the chromium repo: https://github.com/nwjs/chromium.src
Unfortunately we keep all the chromium changes in one patch so the change for this issue is not traceable… The fix is to use the same RenderFrameHost upon navigation during the Window.open API call. In longer term we plan to refactor the NW Window API so this would be solved in a better way.