question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

window object return in Window.open callback is undefined

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
Christywlcommented, Feb 27, 2018

Try http://arxiv.org, got undefined: image

Try https://scholar.google.com/, it returned the window object: image

@rogerwang , could you please help check this issue?

0reactions
rogerwangcommented, Apr 7, 2018

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found