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

NWJS v0.42.4 multiple instance is opening of node webkit #7518

Closed
HarshadUpadhyay opened this issue Jul 10, 2020 · 13 comments
Closed

NWJS v0.42.4 multiple instance is opening of node webkit #7518

HarshadUpadhyay opened this issue Jul 10, 2020 · 13 comments

Comments

@HarshadUpadhyay
Copy link

HarshadUpadhyay commented Jul 10, 2020

I have checked till version 0.42.3 it's working fine. After this as soon as we go ahead with latest release this issue appears like node WebKit multiple windows are appearing. Before it was only single instance was open.

@pratikkaneria
Copy link

require('nw.gui').Window.open(url, {
					title : 'Login',
					frame : true,
					icon : 'logo.png',
					position : 'center',
					height:800,
					width:600,
					id:"login"
				})

It is opening new window everytime .
It was working fine with version 0.42.3, with 0.42.3 already opened window was focusing. But after 0.42.3 it openeing new window everytime i call this function

@HarshadUpadhyay HarshadUpadhyay changed the title NWJS v0.46.4 multiple instance is opening of node webkit NWJS v0.42.4 multiple instance is opening of node webkit Jul 10, 2020
@theDevelopper
Copy link

could this be related with this issue #7516?

@theDevelopper
Copy link

looking at the release notes of v0.42.4 the first version this bug seems to appear makes me wonder if this is related to nw2:

  • NW2 becomes the default mode

I will do some tests with "--disable-features=nw2" to see if that helps

@theDevelopper
Copy link

@HarshadUpadhyay try adding --disable-features=nw2 to chromium-args in your package.json and test again. It solved similar issues for me (#7516)

@HarshadUpadhyay
Copy link
Author

@HarshadUpadhyay try adding --disable-features=nw2 to chromium-args in your package.json and test again. It solved similar issues for me (#7516)

Thank you!! It's also worked for me as well.

But is there any other issue or problem will come if I put "--disable-features=nw2"? I mean what this tag actually does "--disable-features=nw2" in package.json???

@theDevelopper
Copy link

@HarshadUpadhyay nw2 is the "new window" handling logic that will replace the old (now deprecated) logic. It seems the new one needs some more work. (#7230)

@frank-dspeed
Copy link

can some one tag this issue as nw2 :)

@rogerwang
Copy link
Member

Could you please provide a full sample (not code snippets) so we can reproduce?

@HarshadUpadhyay
Copy link
Author

@HarshadUpadhyay nw2 is the "new window" handling logic that will replace the old (now deprecated) logic. It seems the new one needs some more work. (#7230)

With disable-features=nw2 , after using the latest nw.js version 0.47.0 i am not able to access window.location.href after redirection.
It was working fine with version 0.46.3

here is the code i am using

gui.Window.open(decodeURIComponent(loginurl), {
title : 'Login',
frame : true,
icon : 'logo.png',
position : 'center',
height:800,
width:600,
id:"login"
},
function(popupwindow){
if(popupwindow)
{
var isTimerCall = true;
var interval=setInterval(function(){
if(popupwindow.window.location.href.indexOf('http://localhost:4000/login')==0)
{
}
},1000);
}
});

@rogerwang
Copy link
Member

Could you please provide a full sample (not code snippets) so I can reproduce?

@rogerwang
Copy link
Member

close until more information is available.

@h4ck-rOOt
Copy link

On MacOS this is still happening when using "Reload App" from the context menu while the devtools are open. The new application instance will be opened but the existing one isn't closed (devtools will be closed, but the main window remains open). Using "inspect background page" will not show any scripts (in sources tab) when 2 or more instances are open.

My test cases:

  1. Reload App without devtools open => closing all opened instances (correct)
  2. Reload App with devtools open => closing devtools, but leaves main window opened (incorrect)
  3. Reload App with extension devtools (background page) open => closing all opened instances (correct)

Closing both windows (case 2) manually (v50.0.1) will cause a dump in "nwjs" console window:

Screenshot nw.js 50.0.1 dump

With disable-features=nw2 this works afaik. We will stay at v0.36.1 until all of the nw2 bugs are fixed.

I'll create a repo to reproduce this issue as soon as i can.

Maybe helpful infos: v50.0.1 is build with nw-builder (v3.5.7) and this part of the config

{
  "main": "bootstrapper/main.html",
  "node-main": "server/server.js",
  "node-remote": "http://127.0.0.1/*"
}

@h4ck-rOOt
Copy link

h4ck-rOOt commented Mar 25, 2021

Sorry for the late response.
@rogerwang: repro of the nw2 issue is available here

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

6 participants