Add setting or flag to disable Javascript onunload event

My config: Brave 1.77.101 with Chrome 135.0.7049.115, Windows 10 Home x64 22H2

On exiting a web page that is Javascripted, it can use the onunload event to detect when a user leaves a web page. Typically the web site pushes a prompt at the user asking if they want to leave. Of course the user wants to leave, but the web site is desperately trying to keep them at the web site. In addition, the “Want to leave?” prompt locks out the rest of the web browser, so the user cannot click on other tabs to change focus, or just close the nuisancesome tab without bothering to close the prompt. This behavior is very rude.

In Firefox, I set dom.disable_beforeunload = true which disables this Javascript event, so sites cannot attempt to stop me from leaving. No similar option within Brave.