Last Comment Bug 950336 - Add an option to disable onbeforeunload dialogs
: Add an option to disable onbeforeunload dialogs
Status: VERIFIED FIXED
:
Product: Core
Classification: Components
Component: DOM (show other bugs)
: Trunk
: All All
-- normal (vote)
: mozilla29
Assigned To: :Gijs
:
: Andrew Overholt [:overholt]
Mentors:
: 808792 (view as bug list)
Depends on:
Blocks: eviltraps 1107771
  Show dependency treegraph
 
Reported: 2013-12-14 04:46 PST by spamscud2003
Modified: 2014-12-04 17:18 PST (History)
11 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
add a pref to disable onbeforeunload, (2.77 KB, patch)
2013-12-18 06:58 PST, :Gijs
bzbarsky: review+
Details | Diff | Splinter Review

Description User image spamscud2003 2013-12-14 04:46:28 PST
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0 (Beta/Release)
Build ID: 20131112160018

Steps to reproduce:

Type in any form data, then try to leave the page. A popup message will stop you from leaving the page, and tell you "This page is asking you to confirm that you want to leave - data you have entered may not be saved."


Actual results:

This popup message interupted my focus and prevented me from performing the action I wanted to perform.


Expected results:

There should be a way to permanently disable this "feature". It is an annoyance and and a clear vector for security exploit. In my opinion, this "feature" should be turned off by default, or just removed completely from Firefox.
Comment 1 User image Mardeg 2013-12-14 04:48:37 PST

*** This bug has been marked as a duplicate of bug 616853 ***
Comment 2 User image spamscud2003 2013-12-14 06:34:31 PST
This issue is not a replica of bug 616853. I don't care if the popup dialog is tab-modal, I'm asking for an option to COMPLETELY REMOVE this "feature". I see the entire "beforeunload" javascript capability as a bug.
Comment 3 User image spamscud2003 2013-12-15 05:06:30 PST
BUMP. NOT RESOLVED. NOT A DUPLICATE.
Comment 4 User image Jesse Ruderman 2013-12-15 13:53:07 PST
See bug 578828 for changing the default.
Comment 5 User image Drew Willcoxon :adw 2013-12-16 14:13:23 PST
This doesn't need to stay in Untriaged.  There would be a back-end component to this bug, but the summary "Add an option to disable onbeforeunload dialogs" implies a front-end option available to the user, so I'll move it to Preferences.
Comment 6 User image :Gijs 2013-12-18 06:58:24 PST
Created attachment 8349406 [details] [diff] [review]
add a pref to disable onbeforeunload,

I think a pref for this is something we should do. Less convinced about UI for this pref as we've removed UI for much more coarse-grained stuff already, so adding a checkbox for this seems like overkill.
Comment 7 User image Boris Zbarsky [:bz] (still a bit busy) 2013-12-18 08:14:28 PST
Comment on attachment 8349406 [details] [diff] [review]
add a pref to disable onbeforeunload,

r=me of if you fix the spelling of "onbeforeunload" in the comment and add this pref to all.js so it shows up in about:config.
Comment 9 User image Ryan VanderMeulen [:RyanVM] 2013-12-18 18:21:00 PST
https://hg.mozilla.org/mozilla-central/rev/852a854706d4
Comment 10 User image spamscud2003 2013-12-18 22:28:21 PST
Wow, impressive. Thank you guys.
Comment 11 User image :Gavin Sharp [email: gavin@gavinsharp.com] 2014-01-07 17:12:47 PST
*** Bug 808792 has been marked as a duplicate of this bug. ***
Comment 12 User image Manuela Muntean [Away] 2014-03-13 08:28:10 PDT
I wasn't able to reproduce this issue with the Nightly from 2013-11-12 on Win 8 x86 (although I did see that the "dom.disable_beforeunload" pref wasn't available in this build).
I tried with both https://myaccount.nytimes.com/register?action=click&region=Masthead&pgtype=Homepage&module=Registration&contentCollection=Homepage&t=qry746 and 
https://bug17447.bugzilla.mozilla.org/attachment.cgi?id=2467 to close the tabs containing them, but I didn't get any pop-up message.

Could you please provide some URLs that reproduce this issue?
Comment 13 User image :Gijs 2014-03-13 08:47:33 PDT
(In reply to Manuela Muntean [:Manuela] [QA] from comment #12)
> I wasn't able to reproduce this issue with the Nightly from 2013-11-12 on
> Win 8 x86 (although I did see that the "dom.disable_beforeunload" pref
> wasn't available in this build).
> I tried with both
> https://myaccount.nytimes.com/
> register?action=click&region=Masthead&pgtype=Homepage&module=Registration&con
> tentCollection=Homepage&t=qry746 and 
> https://bug17447.bugzilla.mozilla.org/attachment.cgi?id=2467 to close the
> tabs containing them, but I didn't get any pop-up message.
> 
> Could you please provide some URLs that reproduce this issue?

Try the testcase in bug 636374.
Comment 14 User image Manuela Muntean [Away] 2014-03-14 01:23:03 PDT
Verified as fixed with latest Aurora and the testcase in bug 636374, on: Win 8 x86, Ubuntu 13.04 x64, Mac 10.8.5.
Comment 15 User image :Gijs 2014-12-03 16:51:53 PST
Boris, I was discussing this earlier with dolske - the implementation here means no "beforeunload" event fires anymore, which I thought might be broken - ie, we should fire the event but just never show the dialog even when the page says it wants us to (so pretend the user says "yes, I really want to leave" every time).

Would you agree that we should change that? (I'll file a followup bug, but am needinfo'ing here for better context)
Comment 16 User image Boris Zbarsky [:bz] (still a bit busy) 2014-12-04 16:35:06 PST
Hmm.  Yeah, that might be a better idea.

Note You need to log in before you can comment on or make changes to this bug.