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

43.0 reload app doesn't close and open new window #7271

Open
keyto123 opened this issue Dec 11, 2019 · 10 comments
Open

43.0 reload app doesn't close and open new window #7271

keyto123 opened this issue Dec 11, 2019 · 10 comments

Comments

@keyto123
Copy link

keyto123 commented Dec 11, 2019

Thanks for reporting an issue! Spend 60 seconds reading this...

  1. Before reporting, try reproducing against the latest version of NWJS.
  2. Issue tracker is only for bugs and feature requests, in English only.

Anything else? Use our mailing list for questions:
https://groups.google.com/forum/#!forum/nwjs-general

======== TEMPLATE BUG FORM ========

NWJS Version : 43.0
Operating System : Ubuntu

Expected behavior

Close window and open a new window

Actual behavior

Doesn't close window and open a new one

How to reproduce

private project, unable to reproduce it outside the project yet, gonna update this issue as possible

Actually, if you use this package.json it will reproduce
without the node-remote it will only close the app (tested at 43.3)
{
"name": "test",
"main": "https://www.google.com.br",
"node-remote": "<all_urls>"
}

@keyto123
Copy link
Author

keyto123 commented Jan 2, 2020

Updated with reproducible steps

@OsamaAbbas
Copy link

Same here, Reload app button does not work unless if nw2 is disabled via ./nw --disable-features=nw2.

nw.js v0.43.3 on an Ubuntu machine commit hash: af71541-3a532c5-2c167b7-37b2573.

@OsamaAbbas
Copy link

Maybe related:

win.reloadDev() does not work neither. It throws Uncaught TypeError: win.reloadDev is not a function.

@rogerwang rogerwang added the nw2 label Jan 7, 2020
@panther7
Copy link

I think, that we have similar issue.

Command nw.Window.get().close(true) crashing on mac.

Tested on NWjs 0.43.6 (NWjs 0.41.3 works properly), both in nw1 mode.

@rogerwang

@arudnev
Copy link

arudnev commented Feb 6, 2020

We observe similar behavior in regards to App Reload with 0.44.0 on macOS Catalina.

I've been struggling with this for weeks, but only today realized that it's broken on clean install of the app until you run it with --disable-features=nw2 once, after that the reload starts working in nw2 mode.

This can be reproduced with vanilla nwjs sdk install, but the same happens on fresh install of nwjs based app.

  1. cd /tmp && rm -rf nwjs-test && mkdir nwjs-test && cd nwjs-test

  2. rm -rf "${HOME}/Library/Application Support/nwjs"

  3. ~/Downloads/nwjs-sdk-v0.44.0-osx-x64/nwjs.app/Contents/MacOS/nwjs

  4. right click -> Reload App or Simulate Browser Restart

  5. Force Quit the app as Quit from dock icon does not work at this point

  6. ~/Downloads/nwjs-sdk-v0.44.0-osx-x64/nwjs.app/Contents/MacOS/nwjs --disable-features=nw2

  7. Quit nwjs

  8. ~/Downloads/nwjs-sdk-v0.44.0-osx-x64/nwjs.app/Contents/MacOS/nwjs

  9. right click -> Reload App or Simulate Browser Restart, it should work now

By the way, if you try to Reload App or Simulate Browser Restart while running with --disable-features=nw2 some of the menus stop working, i.e. you can not open DevTools or Quit NWJS Default from top menu, can not Quit the app from dock icon.

@arudnev
Copy link

arudnev commented Feb 11, 2020

It seems that starting with 0.44.1 running it once with --disable-features=nw2 workarounds issue with reload in nw2 mode only if you open Devtools before Quit of the app when running with --disable-features=nw2 (and only if you Quit the app from dock icon menu, Cmd+Q does not have this effect).

You can do Reload App in nw2 mode after that, but it seems that some app data gets corrupted again and blocks reload if you do Simulate Browser Restart (after which you have to start app in nw1 mode, open Devtools and Quit app from dock icon menu to fix whatever is getting corrupted).

Also, based on #7367 it seems that on Windows it also has problems with Reload App / Simulate Browser Restart, so the issue is not platform specific, but it's not clear if there is workaround on other platforms.

@rogerwang
Copy link
Member

This is fixed in git and will be available in the next nightly build.

@keyto123
Copy link
Author

Happens on linux at 44.2
Breaks without node_remote, open another window without closing old window with node_remote

@rogerwang rogerwang reopened this Feb 24, 2020
@f3l1x
Copy link

f3l1x commented Apr 28, 2020

Same at me, OSX, 0.45.4-sdk.

  1. Open window.
  2. Open devtools window.
  3. Right click and choose Reload App.
  4. It closes devtools window. Opens new window. Old window still presence.

If I close devtools window first, then Reload App works as expected. Same for Simulate Browser Restart.

nw.Window.get().reloadDev() does not work neither.

image

@stale
Copy link

stale bot commented Jan 9, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jan 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants