Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NW2] nw.Window.get() throws exception No current window #7467

Closed
djcanard opened this issue May 8, 2020 · 2 comments
Closed

[NW2] nw.Window.get() throws exception No current window #7467

djcanard opened this issue May 8, 2020 · 2 comments

Comments

@djcanard
Copy link

djcanard commented May 8, 2020

NWJS Version : 0.42.4 (and newer)
Operating System : Windows 10 64-bit
#7230

Expected behavior

nw.Window.get() should get the current window.

Actual behavior

It throws an exception with message No current window.

How to reproduce

I tried several nw.js versions and the issue occurs since 0.42.4.
When I use --disable-features=nw2 the exception does not occur.

I created a stripped down version of our full-blown app to demonstrate the issue.
See attachment.
nwjs-window-get-example.zip

@rogerwang
Copy link
Member

You are creating a Chrome App window, not a NW window. So it's expected that nw.Window.get() will hit error.

In NW2 mode the NW window is not implemented with Chrome App window anymore.

@djcanard
Copy link
Author

djcanard commented May 9, 2020

We distribute our apps for several platforms; Windows, Linux, MacOS and Chromebooks using 1 codebase which is great!
So I guess we should rewrite the code that creates the window into two different mechanisms, one for ChromeOS and one for the other platforms, right? Or is there some other way to keep it one mechanism?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants