[nwjs/nw.js] 7fea3b: fix #8283: nw.App.on('open') callback only fires once on subsequent app launches

0 views
Skip to first unread message

commits...@nwjs.io

unread,
May 3, 2026, 6:30:23 PMMay 3
to node-we...@googlegroups.com, ro...@nwjs.io
Branch: refs/heads/main
Home: https://api.github.com/repos/nwjs/nw.js
Commit: 7fea3b5ca95187c372ef128d8ef2cec22262b09d
https://github.com/nwjs/nw.js/commit/7fea3b5ca95187c372ef128d8ef2cec22262b09d
Author: Kevin Fan <k...@gnor.net>
Date: 2026-05-03 16:27:33 -0600 -0600

Changed paths:
M src/resources/api_nw_app.js
A docs/issue-8283-app-on-open-event.md

Log Message:
-----------
fix #8283: nw.App.on('open') callback only fires once on subsequent app launches

The API bridge's argument parsing (APISignature::ParseArgumentsToV8) wraps
JS function callbacks into native V8 bindings that become dead after the first
invocation. Since the event emitter stores the wrapper, not the original
function, subsequent event dispatches invoke a dead binding.

Fix: define on/once/removeListener/removeAllListeners as direct JS methods
on compiledApi, bypassing the API bridge's argument parsing entirely. This
matches how nw.Window.on works in api_nw_newwin.js.


Reply all
Reply to author
Forward
0 new messages