Close tab means close tab

sm625

Diamond Member
May 6, 2011
8,172
137
106
I'm sure you've been to those websites which pop up an annoying message when you attempt to close the tab. I am looking for a way to make that little X button actually work the way it should, for all sites, at all times. If I click close tab, I want it to always close the tab, 100% of the time, no exceptions. Is there a way to do this simple thing on firefox or crome?
 

ninaholic37

Golden Member
Apr 13, 2012
1,883
31
91
I think setting dom.disable_beforeunload to true in about:config in Firefox does this. I tried typing a message in the Comments on someone's picture on Facebook, and when the value is false it asks "The page is asking you to confirm that you want to leave - data you have entered may not be saved", but when it's set to true it lets me leave without the warning.
 

lxskllr

No Lifer
Nov 30, 2004
59,408
9,931
126
It's probably done with javascript, so you'd have to block the script before it loads. By doing that, you also block the stuff you want to see

Edit:
I think setting dom.disable_beforeunload to true in about:config in Firefox does this. I tried typing a message in the Comments on someone's picture on Facebook, and when the value is false it asks "The page is asking you to confirm that you want to leave - data you have entered may not be saved", but when it's set to true it lets me leave without the warning.
This looks like it should work. I didn't know that preference was there.
 
Last edited:

Morbus

Senior member
Apr 10, 2009
998
0
0
I'm sure you've been to those websites which pop up an annoying message when you attempt to close the tab. I am looking for a way to make that little X button actually work the way it should, for all sites, at all times. If I click close tab, I want it to always close the tab, 100% of the time, no exceptions. Is there a way to do this simple thing on firefox or crome?
I'm sure there is a way to make it work like you want it to in Firefox, using an extension, but not on Chrome.

What you request goes against HTML standards, as far as I'm aware, in that some javascript functions are fired and override (to a degree) the close function of a tab/window. The window close confirm dialog comes to mind, but I do believe the alert dialog and the confirm dialog in general also must be addressed before closing a tab (hence why browsers will usually allow the user to block all alert and confirm dialogs from a site).

TL;DR try addons.mozilla.org, but don't expect much. You're better off asking a developer to develop it for you. To my knowledge, it shouldn't be fore than a couple of hours of coding and testing.

I think setting dom.disable_beforeunload to true in about:config in Firefox does this. I tried typing a message in the Comments on someone's picture on Facebook, and when the value is false it asks "The page is asking you to confirm that you want to leave - data you have entered may not be saved", but when it's set to true it lets me leave without the warning.
When you have an alert or confirm on screen, I don't think it allows you to close the tab unless you close the alert/confirm.
 

sm625

Diamond Member
May 6, 2011
8,172
137
106
I think setting dom.disable_beforeunload to true in about:config in Firefox does this. I tried typing a message in the Comments on someone's picture on Facebook, and when the value is false it asks "The page is asking you to confirm that you want to leave - data you have entered may not be saved", but when it's set to true it lets me leave without the warning.

Excellent. Thanks. It works great.

When you have an alert or confirm on screen, I don't think it allows you to close the tab unless you close the alert/confirm.

Yeah it would be much more difficult to do that since you no longer get access to the parent window until the child window is dismissed. But that's ok.