My app handles the running instances of every window and it was working good with 0.14 & 0.15.
On v 0.16 I see there is some problem with nw.global.__nw_windows
It doesn't store always the right number of opened windows.
E.g. if I open 5 windows I see just 2 NWWindow object inside nw.global.__nw_windows
@rogerwang is there any other way to get all running windows (nwwindow instances)? I'm trying chrome api but it doesn't allow to access the window object (e.g. window.document)
@rogerwang just tested on Windows and it's the same... very often some window instance will not be tracked to the __nw_windows store var.
We'll provide nw.Window.getAll(). Before that you can use https://developer.chrome.com/apps/app_window#method-getAll
We'll see the issue about __nw_windows.
@rogerwang tested even with chrome.app.window.getAll() and it's the same... worst.. it shows only 1 AppWindow running (when actually I have 5 windows).
Instead if I use chrome.windows.getAll(function(wins) { console.log(wins) }) it works but this method will not give us access to the contentWindow node (to access the document)
@rogerwang do you have any planned date for this issue solving? It could be blocking for who need to handle number of window instances. Thank you
up
@rogerwang tested the new version 0.17 (latest):
on MacOS version nw.global.__nw_windows now works well
on Windows version nw.global.__nw_windows does not hold the correct number of windows (tested on Windows 7)
Hello @rogerwang
is this issue a 0.18 version priority?
Sorry if I'm repetitive but I just need to know if I have to develop my own window manager.
Thank you
@AndryBray I'll try to fix it soon in 0.17. Thanks.
does it happen only when you open windows with remote URLs?
I only use remote urls. I'll try with local as well
@rogerwang I've just tested the live build version https://dl.nwjs.io/live-build/09-10-2016/nw17-4c8d707-20839a2-dacfec0-65b948e/v0.17.2/
I still have the same problem (tested on Windows 7)
Did you test with chrome.app.window.getAll()? That's what I was fixing.
@rogerwang OK. I was still using the nw.global.__windows object instead of chrome API.
Using the chrome api it seems to work.
Just for info:
using chrome.app.window.getAll() with the sdk build, if I have dev console opened I get an array with NULL values like: [AppWindow, null, AppWindow]
Maybe the null value could be skipped automatically.
It's a pity that we still have problems with nw.window.open callback with undefined wind value.
I think https://github.com/nwjs/nw.js/issues/4188 is still there.
@rogerwang is this bugfix applied on 0.14.x version as well?
@rogerwang about the NULL value I found it's not related to dev console but chrome.app.window.getAll() will return NULL values if you try to reload the content (CMD+R) of window.
I think this shouldn't be the normal behaviour.
Tested on 0.18 beta-1 as well.
Yes, it will be applied to LTS branch too. Reopen to track this.
@rogerwang it would be nice to have a kind of roadmap for issues just to know your estimation about the problems solving or just to know if you are working on.
Thank you, I appreciate your effort in every release you publish.
Any idea about this one especially?
Will see this before 0.17.3. I was about to fix it in 0.17.2 but was
occupied by upstream release with security updates.
On Wed, Sep 14, 2016, 9:43 PM AndryBray [email protected] wrote:
@rogerwang https://github.com/rogerwang it would be nice to have a kind
of roadmap for issues just to know your estimation about the problems
solving or just to know if you are working on.
Thank you, I appreciate your effort in every release you publish.Any idea about this one especially?
—
You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub
https://github.com/nwjs/nw.js/issues/5181#issuecomment-247016760, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAKGGV95n4kcDb3C0Cgkd9OQrvSCool0ks5qp_n2gaJpZM4JaYfu
.
Google just released another Chromium stable update in the next day after the previous one. So I'm going to release 0.17.3 soon and this issue will be likely slip into 0.17.4.
returning null is fixed in #5294
@rogerwang tested even with
chrome.app.window.getAll()and it's the same... worst.. it shows only 1 AppWindow running (when actually I have 5 windows).Instead if I use
chrome.windows.getAll(function(wins) { console.log(wins) })it works but this method will not give us access to the contentWindow node (to access the document)
it does work you just have to remember that the window opens in the context of the newly focused window. if you open chrome debugger of the latest window you should see that all your windows are all open.
place this inside the callback of your xx.open(..., ( childwin) => ....
const oWindows = childwin.window.chrome.app.window.getAll();
oWindows.forEach((oWindow) => {
if (oWindow.id !== '' && oWindow.id !== modalName) {
oWindow.close(true);
}
});