Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firefox This page is asking you to confirm that you want to leave

I have a script that if user is uploading file and try to close the browser it will trigger the onbeforeunload() and popup an alert.. I change the message but somehow it does not work in firefox, it works perfectly fine on IE or opera or safari.. the code is something like

window.onbeforeunload = checkUnload;
function checkUnload() {

if (document.upload.isEmailing())
    return "Aaaa";

So, in IE and opera, when users close the browser during emailing, it will show pop up saying "AAAA" with leave or stay page button.

However, in firefox, it show

"This page is asking you to confirm that you want to leave - data you have entered may not be saved." with leave or stay page button.

Why it does not work, am I doing something wrong?

Note: FF I am using is the latest version if that will help.

like image 451
Harts Avatar asked Feb 23 '12 19:02

Harts


People also ask

How do you stop this page is asking you to confirm that you want to leave information you've entered may not be saved?

(1) In a new tab, type or paste about:config in the address bar and press Enter/Return. Click the button accepting the risk. (3) Double-click the browser. backspace_action preference to display an editing field, and change the value to 2 then press Return or click the blue check mark button to save the change.

How do I get rid of authentication required in Firefox?

Windows: "3-bar" menu button (or Tools menu) > Options. Mac: "3-bar" menu button (or Firefox menu) > Preferences. Linux: "3-bar" menu button (or Edit menu) > Preferences. Any system: type or paste about:preferences into the address bar and press Enter/Return to load it.

Why do I keep getting signed out of Firefox?

Your 'logged-in' status is stored in special cookies. If the cookie is removed, you are logged out. You may be in Private Browsing mode or told Firefox not to remember. Type about:preferences#privacy<enter> in the address bar.


1 Answers

For security reasons, Firefox now ignores the string you return.
There is nothing you can do about it.

like image 138
SLaks Avatar answered Sep 23 '22 08:09

SLaks