Stop popping up when I'm about to switch the tab!
May 20, 2015 6:53 AM   Subscribe

A growing number of websites these days will detect when the cursor moves off of the website up to the tab bar, and pop up a message trying to get the user to stay/sign up for their newsletter/etc. How do I block this from happening?

I have tried to google around for this, but I honestly have no idea how this works or what it's called.

Most of the time I'm not even closing the window when this happens, but rather clicking over momentarily to a different tab. So the popup is not only not doing its job of preventing me from closing the tab (since I'm not closing the tab), but also obscuring the thing that I was trying to read.

Is there an adblock/noscript/greasemonkey/etc solution that will stop these things from detecting that I've moved my cursor away?
posted by Gordafarin to Computers & Internet (15 answers total) 10 users marked this as a favorite
You can probably locate the script responsible for this by using the "Open blockable items" selection in AdBlock. Then, simply tell ABP to block it.

FWIW, I've not encountered such an event on a website. It sure would drive my nuts, and I'd probably never return to such a site.
posted by Thorzdad at 6:56 AM on May 20, 2015

If you are on a Mac download and install Adwaremedic.
posted by Mac-Expert at 7:11 AM on May 20, 2015

Just use NoScript to block Javascript. For what it's worth, I've never come across this on any vaguely legitimate site so chances are you have some malware installed. Can you name some sites where you experience this? Also keyboard shortcuts for closing tabs save a lot of time and issues like this.
posted by turkeyphant at 7:16 AM on May 20, 2015 [4 favorites]

I just sat in on a presentation from Qualaroo for a website I work on, and they demoed this exact feature (among other kinds of pop ups that ask questions, gather emails, etc) -- so there's a company to be grumpy at, at least.
posted by cubby at 7:36 AM on May 20, 2015 [1 favorite]

Can you please post examples of websites that do this?

It sounds like it's likely listening for mousemove events and triggering when the vector of the mouse's movement would send you off the top of the page. There's also the the Page Visibility API, which is supported by all major browsers and notifies a page when you minimize it or switch to a new tab. Non-nefarious uses include automatically pausing videos when you're on another tab.
posted by SemiSophos at 7:55 AM on May 20, 2015

Response by poster: It isn't malware, and it's not dodgy sites (well it's mostly digital marketing blogs, so your opinion may vary on that point!) - here is an example of an offender (screenshot).

I was hoping there would be a quicker solution than blocking them on a case-by-case basis, which is rather like playing a game of whack-a-mole since lots of companies offer this "feature" and lots of different websites use it.
posted by Gordafarin at 7:57 AM on May 20, 2015 [1 favorite]

I put the urls of the sites that hold the popups in my hosts file mapped to
This is mainly useful if you return to the same sites repeatedly.
posted by Obscure Reference at 8:27 AM on May 20, 2015

Wow, that's fantastically well designed and horrible! One sec, digging into the source.
posted by SemiSophos at 8:31 AM on May 20, 2015 [2 favorites]

I just had this happen on - you'd think they'd track that I clicked in from their email before bugging me about subscribing to their emails.
posted by robocop is bleeding at 8:52 AM on May 20, 2015 [2 favorites]

µMatrix seems to prevent this from showing up for me.
posted by books for weapons at 8:56 AM on May 20, 2015 [1 favorite]

It's called "exit intent", usually for opt-in pop ups (if it'll help you Google blockers). AdBlock should kill it though. And it's not just a feature of spam sites, it's considered a marketing best practice in way too many industries. It frequently breaks on mobile. It is annoying as all hell.
posted by annathea at 8:59 AM on May 20, 2015 [1 favorite]

I hate this stuff too. I played around with it, and a workaround is to use your browser's keyboard shortcuts to switch tabs.
posted by Leontine at 10:08 AM on May 20, 2015

In your example, selective enabling in NoScript reveals that that code is from wishpond themselves. I didn't dive in to see what exact code was triggering it, but it's easy enough to detect when the mouse leaves the viewport. Long story short, NoScript will prevent it.
posted by rhizome at 11:46 AM on May 20, 2015

Best answer: Sorry for the delay. Looks like all of these are triggered by mouseleave or mouseout events attached to either the root document or to document.body. When your mouse leaves the page, they check the MouseEvent.clientY property to determine where your mouse was when it left the document. If it's negative or very small, that means you moused out in the direction of your tab bar, which triggers the overlay. In the case of the article you linked above, it calls;.

Ad-blocking / tracker-blocking extensions are likely to block this sort of thing, as would NoScript if you're willing to put up with it. Otherwise, there isn't really a reasonable way to suppress mouse events or their handlers.

As a fallback, consider getting comfortable with keyboard shortcuts like Ctrl-W (Windows) or Cmd-W (Mac) to close your browser tabs. Or, if possible, stop visiting sites run by jerks. ;-)
posted by SemiSophos at 11:46 AM on May 20, 2015 [2 favorites]

Best answer: I spent hours Googling this a couple days ago. (They're called overlays, FWIW. Took a while to figure that out because Googling "pop up" wasn't getting me anywhere.) They aren't always triggered by mousing away from the site -- I think some of them are timed.

AdBlock plus doesn't do squat, and I find disabling JavaScript to be a pain. There's an add-on for Chrome/Firefox called Behind the Overlay; it helps you close them quickly with a keystroke. It's not as good as getting rid of them entirely, but it's reduced my agitation somewhat.
posted by mudpuppie at 12:05 PM on May 20, 2015 [2 favorites]

« Older Book Suggestion for 16-year-old Manga, GoT-loving...   |   Should I ask my uncle about his Big Secret car... Newer »
This thread is closed to new comments.