-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Window doesn't close with close
event handler and window.close()
#7808
Comments
Tested locally and could reproduce in NW.js 0.58.0-SDK on Win 10 64:
Min Repro: |
Verified bug is not present in:
Verified bug is present in:
Diff: |
Yesterday I was struggling with |
Thanks for the sample and testing. but the bug is in 0.50.0 as well |
@rogerwang Updated table with tested versions and relevant diffs |
An interim solution, Works for me :) chrome.tabs.onRemoved.addListener(() => {
nw.Window.getAll((list) => {
list.forEach((win) => {
if (win.cWindow.tabs.length === 0) {
win.close(true);
}
});
});
}); |
NWJS Version : 0.58.0
Operating System : Windows 10
Expected behavior
When a window uses
window.close()
, handling of theclose
event should behave the same as ifnw.Window.get().close()
was called or the user manually closed the window.Actual behavior
If
window.close()
is used to close a window, an event handler cannot be attached to theclose
event. If an event is attached, the window does not actually close whenwin.close(true)
is called.How to reproduce
The text was updated successfully, but these errors were encountered: