I'm working on what should be a simple Greasemonkey script to confirm that you want to close the window if you have a lengthy message typed.
I had a working version of this script a few years back, but the website it worked for has undergone changes, so I'm hoping to fix it. However, I can't even get a simple confirmation to work:
function confirmClose() {
return 'You have a long message typed. Are you sure you want to close?';
}
window.addEventListener('beforeunload', confirmClose, true);
I'm positive the script is running on the pages it should, but whenever I attempt to close the window, I don't receive any confirmation.