How To Click A Button In A Popup?

What's the best way to deal with webpages that won't let you leave or close your browser without clicking on a button in a message box?

  • MLM sites, dietary scam hucksters, phony investment rackets and pushy porn sites all use them. I inadvertently click to the page, and when I try to close the browser tab, hit the back button, or even completely close the browser; I instead get a message popup (despite having a popup blocker in place). It will say something like "Are I sure you want to leave this page?" and will offer buttons with messages like "Stay on page" and "Leave page" as actions. Such message boxes can be useful when used for honest ends. In fact, Quora uses them to keep us from writing a post then inadvertently leaving the page without posting it. So I don't want to completely prevent such messages. But I do want to know how to escape them on sites I have good reason to distrust. Without a lot of detective work, I have no idea what I am really agreeing to do, to download, etc. if I click any button on such an obviously ill-intentioned page. Yet anything I do to try to close out without hitting one of the message boxes' buttons just brings me back to the scam artist's plagued popup, perhaps making it flash a few times to attract attention to itself. Even keyboard shortcuts like Ctrl + W and Alt + F4 do not work. All normal ways of navigating off the page are blocked. I'm using Windows 7 with the three-fingered salute (Ctrl + Alt + Del) enabled, so when I hit this sort of thing, I use Ctrl + Alt + Del to bring up the log on/off screen then select Task Manager and use it to shut down the browser session. But last night I hit one that was inordinately persistent. I went to the task manager and closed Chrome, but Chrome didn't close. I tried Ctrl + Alt + Del again and it would not work. The only solution was to go through a full shut-down. What is the best way to deal with such annoyances, and is there anyone I can complain to about such abusive pages that might actually do anything about them?

  • Answer:

    Actually, this dialog is triggered from the beforeunload event of the window. The only control the application has over this dialog is whether it appears, and the prompt text. If you choose to leave, they get no notification of that. It is safe to choose to leave.

Glenn Anderson at Quora Visit the source

Was this solution helpful to you?

Other answers

The AdBlock extension for chrome will get rid of lots of those the links before you even see them. It's easy to add more blocks if something still manages to slip through. And if you really wanna get fancy, get greasemonkey. It does way more than just block ads. You can completely customize the pages you visit often, changing the font, background color, layout, anything, really.

Jennifer Dowdy

They can't stop you closing your browser [can they? I never met that!] The best trick is not go there in the first place - but certainly never go back. And never ever buy a product that uses bad web advertising techniques.

Andrew Heenan

Generally these types of prompts are implemented using Javascript, so if you have a JS blocker like NotScript.

Jeremy Spencer

I would use ctrl + alt + del and close the browser program running in task manager. When reopen the browser do not reload previous tabs that were open.

Jacob Lett

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.