cancel
Showing results for 
Search instead for 
Did you mean: 

How can I force a window to close if it continually opens dialog boxes asking to confirm

Highlighted
New Contributor

How can I force a window to close if it continually opens dialog boxes asking to confirm

I have come across pages from time to time that try to prevent me from closing them by continuously opening dialog boxes. Generally these come up as pop-ups or hidden redirects from other pages, rather than from a site that I actually intended to visit. The only fix that currently works is to drag the offending tab into it's own window and ignore it. This allows me to continue browsing, but the only way to get rid of it is to force quit Firefox.

When I did a web search for a way to prevent any further dialogs from opening from a given page all I could find were repeated requests to get rid of the feature and no way to get it back now that it's gone.

My suggestion would be to make an option available, if it does not already exist and easily accessible to force close a tab. This action should kill any scripts that it might be running and close it with out permitting any dialog boxes, pop-up windows or any other action. Placing it in the right click menu alongside "close tab" would be ideal, though if this is considered dangerous in the hands of the average user then create it and use a preferences bit to enable it so advanced users can enable it themselves.

13 REPLIES
New Contributor

Re: How can I force a window to close if it continually opens dialog boxes asking to confirm

You can go in the windows process manager and you click on process. You select firefox.exe (or firefox.exe*32 if you have Windows 7 or 8) and you click on Kill process. If you wan't, there is a program for advanced user to kill process : process explore. There is the link to download it here : http://technet.microsoft.com/en-gb/sysinternals/bb896653.aspx

New Contributor

Re: How can I force a window to close if it continually opens dialog boxes asking to confirm

Thanks LeGeekDuOpenSource, unfortunately that's just the Windows version of the workaround that I'm currently using. On the Mac it's Force Quit but the effect is the same - it kills all Friefox windows but cannot selectively kill individual windows or tabs.

Legendary Contributor

Re: How can I force a window to close if it continually opens dialog boxes asking to confirm

There are so many ways to abuse the reader... I don't think the built-in features will ever be able to block all of them.

What kind of dialogs are you getting? The block on repeated dialogs (alerts, for example) generally applies to those that repeat within a script. If the page reloads in between, or other events intervene, that likely would bypass the block.

Related threads regarding "onbeforeunload" ("do you want to leave") problem:

New Contributor

Re: How can I force a window to close if it continually opens dialog boxes asking to confirm

Those other posts look like the same type of error - typically they are "Are you sure you want to leave?" Type messages in a continuous cycle

I was hoping there might be a feature or plugin to kill scripts within a given tab or window.

New Contributor

Re: How can I force a window to close if it continually opens dialog boxes asking to confirm

I don't know if a pluggin exist ... Sorry. I don't have a mac.

New Contributor

Re: How can I force a window to close if it continually opens dialog boxes asking to confirm

I had this problem. Jscher2000's suggestion worked for me this way: I moved the persistent tab to a new window and observed its refresh cycle; when the script was mid-refresh I pushed ALT+F4 (close window).

Also, within the persistent "Confirmation" prompt windows produced by a different page there was a checkbox titled "Prevent this page from creating additional dialogues", which I presume/hope was placed there by Firefox and was not malicious (it may be a feature of my Firebug addon, but I'm not sure). I checked the box, which forced the page to reload, and during the reload I pressed ALT+F4 to close the window.

tl;dr:

await script refresh>ALT+F4 (Windows, close window) OR
check "disallow future dialogs">await script refresh>ALT+F4
New Contributor

Re: How can I force a window to close if it continually opens dialog boxes asking to confirm

I could try the close window mid-refresh option if there's time to catch it. The "disallow future dialogs" isn't present in the standard firefox so it could be a feature of one of your add ons. Either way, firebug might be suitable for such pages by simply pausing the scripts prior to closing the page...

Legendary Contributor

Re: How can I force a window to close if it continually opens dialog boxes asking to confirm

Hi ben_burrowes, the disallow future dialogs checkbox appears on normal sites, no add-on required, but apparently some sites have found a way around it.

In a thread about a different inescapable website problem a user suggested gutting the page using the Inspector. I haven't tested it on the kind of page you're encountering, but here's how you would do it: right-click a blank area near the margin of the page, and choose Inspect Element (Q). This should open a panel with some element of the page's HTML code selected. You're looking for the <body> tag, scroll up if necessary, then right-click it and choose Delete Node. You also could delete the <head> node. There's a good chance this will cripple the script that's preventing you from leaving the page. Obviously not an approach you would want to have to use often, but you could practice it for potential emergencies.

New Contributor

Re: How can I force a window to close if it continually opens dialog boxes asking to confirm

I found the following fast way to close Firefox page on Windows with Firefox 26:

- Press F12. This will open developer tools pane.

- Click on star icon on the left. This should open Toolbox options.

- check Disable Javascript (Current version only, reloads the page).

- while page is reloaded, close it by clicking on close (cross) icon or use Alt+F4 or whatever you prefer.

Note that the previous advise to use right click and Inspect Element (Q) does not work because most pages block right clicks these days. But F12 appears to always work. I guess there should be a similar sequence on Mac.