Skip to content

Add nw.App.restart API#8351

Open
apples-kksk wants to merge 2 commits into
nwjs:mainfrom
apples-kksk:add-nw-app-restart
Open

Add nw.App.restart API#8351
apples-kksk wants to merge 2 commits into
nwjs:mainfrom
apples-kksk:add-nw-app-restart

Conversation

@apples-kksk
Copy link
Copy Markdown

@apples-kksk apples-kksk commented May 14, 2026

Implements nw.App.restart() and legacy nw.gui.App.restart() by scheduling a relaunch during browser shutdown and then reusing the existing app quit path.

The relaunch command preserves the original invocation argv, including argument order and -- handling, while normalizing the current NW app path so relative app launches restart correctly across platforms.

Fixes #149

Tests:

  • git diff --check
  • python3 -m py_compile test/sanity/app-restart/test.py
  • python3 -m json.tool test/sanity/app-restart/package.json

Not run locally:

  • sanity/app-restart, because it requires CHROMEDRIVER/NW SDK build output.
  • test/test.py runner, because Python 3.14 no longer includes the imp module used by the runner.

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

Successfully merging this pull request may close these issues.

Api suggestion: API.App.restart

1 participant