You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.
When window.onbeforeunload is set, and it returns a string, the tab should not be closed unless the user confirms a prompt. This does not happen on Brave. #4079 states it is fixed, but it does not work as intended in either 0.19.x or 0.21.x, for tab close events. It does, however, work when refreshing or navigating away in the same tab.
FYI it seems like the way that other browsers protect against malicious sites defining an 'alert' trail by traversing multiple sites which all define onbeforeunload handlers, is to require that some user focus be actioned inside a frame before allowing the handler to be registered.
Description
When window.onbeforeunload is set, and it returns a string, the tab should not be closed unless the user confirms a prompt. This does not happen on Brave. #4079 states it is fixed, but it does not work as intended in either 0.19.x or 0.21.x, for tab close events. It does, however, work when refreshing or navigating away in the same tab.
Steps to Reproduce
Actual result:
Tab closes
Expected result:
A prompt should be shown confirming if the user really wants to close the tab.
Reproduces how often: 100%
Reproducible on current live release:
Yes
Additional Information
Chrome, Safari and Firefox all present dialogs with 'Leave' and 'Stay' buttons.
The text was updated successfully, but these errors were encountered: