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: How to retrieve opened windows as nw.Window object? #7227

Closed
cyantree opened this issue Nov 20, 2019 · 5 comments
Closed

nw2: How to retrieve opened windows as nw.Window object? #7227

cyantree opened this issue Nov 20, 2019 · 5 comments
Labels

Comments

@cyantree
Copy link

NWJS Version : 0.42.5
Operating System : Win 10

Expected behavior

As in NW1 with chrome.app.window.getAll() there's an api for retrieving all opened windows and accessing their contents.

Actual behavior

The said api doesn't work anymore. It's possible to retrieve some information with chrome.windows.getAll({populate: true}, console.log) however I don't know how to find the appropriate window objects from there.

How to reproduce

  • chrome.app.window.getAll() now only returns an empty array.
@rogerwang
Copy link
Member

Do you want to access the DOM window or the nw.Window object?

@cyantree
Copy link
Author

Both ways are fine to me as it is possible to get the other object by using nw.Window.get(domWindow) or nwWindow.window. Do these methods still work with nw2?

@rogerwang
Copy link
Member

Added nw.Window.getAll() and it will be available in the next nightly build.

@cyantree
Copy link
Author

Nice, thanks!

@cyantree
Copy link
Author

cyantree commented Dec 8, 2019

Just tested it in v0.42.6. Works nicely, thanks again!

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

No branches or pull requests

2 participants