Greasy Fork is available in English.
Disable page close confirmation (onBeforeUnload)
< Feedback em Disable page close confirmation
I've just strengthened the script a little to fight such cases, but this particular page is an unrealistic simplified example so it'll be still failing with the new script due to limitations of Tampermonkey/Chrome (it fails to run userscripts before the embedded page scripts) but that's not important in real more complex sites.
Not working (test page attached)
I tried pressing the Close button. (A warning Alert Pop-up.)
I tried pressing the Back button. (A warning Alert Pop-up.) This script didn't work at all.
OnBeforeUnload Test Page: http://sahitest.com/demo/onBeforeUnloadTest.htm