LWN.net Logo

Advertisement

GStreamer, Embedded Linux, Android, VoD, Smooth Streaming, DRM, RTSP, HEVC, PulseAudio, OpenGL. Register now to attend.

Advertise here

Blocking popups in FireFox

April 6, 2005

This article was contributed by Joe 'Zonker' Brockmeier.

One of the most compelling features of Firefox, for many users, is its built-in pop-up blocking. However, the advertising networks and webmasters looking to inflict pop-up ads on users weren't content to allow Firefox users (or anyone else, for that matter) to browse in peace. It's not surprising that, as Firefox gains in popularity, the Mozilla team would be faced with an "arms race" with advertisers determined to spawn pop-ups on all visitors to sponsored sites.

This writer has recently noticed that some sites had begun spawning pop-ups, despite the fact that Firefox's preferences had been configured to block them. After so long without having to cope with pop-ups, it was doubly annoying to see the nuisance starting all over again.

For the most part, before Firefox and other pop-up blockers appeared on the scene, pop-ups and pop-unders were spawned by JavaScript as soon as a site loads. The Firefox pop-up blocking settings were very successful in blocking almost all pop-up ads. The notable exception, at least for this user, was the New York Times website, which was one of the first sites to find a workaround for Firefox's pop-up blocking.

JavaScript, however, is not the only method that can be used to spawn pop-ups. Notably, Flash, Java and other plugins are capable of spawning pop-ups and bypass the restrictions used to stop pop-ups spawned by JavaScript. To start blocking pop-ups on sites that take advantage of features in Flash or Java to spawn pop-ups, users can install the Pop-ups Must Die! extension.

Alternately, users can get the same effect by manually fine-tuning Firefox's settings. The first change, adding "privacy.popups.disable_from_plugins" is described here. The extension also changes the value of "dom.popup_allowed_events" to block all allowed pop-up events. This can be done by entering "about:config" in the Firefox address bar, and finding "dom.popup_allowed_events," and removing all of the options. These are the only two changes made by the extension.

The changes seem to have been very effective -- perhaps a little too effective. Several users have complained that the extension blocks requested pop-ups as well. This is true, but Firefox still allows users to whitelist sites after a pop-up has been blocked by the new settings. This writer considers it a small price to pay to avoid unrequested pop-ups. For those who would rather deal with the occasional unrequested pop-up, one may change "privacy.popups.disable_from_plugins" to "1" to allow pop-ups to be opened when a link is clicked. This will limit the number of windows opened by a link, so nefarious webmasters cannot open an unlimited number of windows.

Determined webmasters, however, can find ways to inflict advertising on users in other ways. Consider this site which was pointed out in the discussion about the "Pop-ups Must Die!" extension. Rather than spawning a pop-up, it creates a frame within the window that blocks the content of the site until the frame "window" is closed. Without disabling frames, which would cause a great deal of problems for sites that use them legitimately, it's difficult to imagine how one could avoid this kind of "pop-up." (Note, disabling frames by changing the value of "browser.frames.enabled" to false appears to break Firefox entirely.)

Ultimately, the best solution may not rest with Firefox. Users who are offended by pop-ups, and other intrusive advertising, have an infallible weapon at their disposal -- stop visiting sites that insist on using pop-ups. While it would require a great number of users to be effective, even the most persistent webmasters and advertisers would have to reconsider their methods if they have no audience for their ads.


(Log in to post comments)

Blocking popups in FireFox

Posted Apr 7, 2005 6:29 UTC (Thu) by beejaybee (guest, #1581) [Link]

"stop visiting sites that insist on using pop-ups. While it would require a great number of users to be effective, even the most persistent webmasters and advertisers would have to reconsider their methods if they have no audience for their ads."

Sure. Unfortunately this is likely to be approximately as effective as stopping the spread of Windows viruses through asking MS Outlook users to refrain from clicking on unsolicited attatchments.

Firefox actually (still) does a pretty good job.

The Final Solution to the pop-up problem would seem to depend on two factors: (a) for extensions similar in effect to "Pop-ups Must Die!" to be built in to all browsers (even MSIE), and activated by default; (b) for responsible web site managers to fire on the spot any web author who inserts code generating pop-up like activity into a web page.

Blocking popups in FireFox

Posted Apr 7, 2005 15:10 UTC (Thu) by amarjan (guest, #25108) [Link]

In the meantime, heavy use of the Adblock extension and Privoxy (http://www.privoxy.org) will deal with virtually all popups, at least for determined users.

Blocking popups in FireFox

Posted Apr 7, 2005 23:08 UTC (Thu) by xtifr (subscriber, #143) [Link]

Another option that hasn't been mentioned is the "click-to-flash" extension, which prevents flash from starting unless and until the user clicks on the space where the flash would appear. The advantage to this is that it allows legitimate popups created by flash to still appear, while blocking the "sneaky" ones contained in ads - in fact, the flash ads go away completely. (Java popups are a separate problem, which I've solved by not installing java.)

With image animations disabled, and the click-to-flash extension installed, the WWW becomes a remarkably calm and peaceful place. I'm always appalled when I use someone else's machine, and see all these pages filled with annoying wiggling things trying to distract me from my reading, because it's not like that on my box! :)

Blocking popups in FireFox

Posted Apr 8, 2005 6:18 UTC (Fri) by beejaybee (guest, #1581) [Link]

If you're prepared to not install java, why not simply not install flash as well? In fact this is quite easy - AFAIK it's the default state even in Windows, though at least one major linux distribution does install flash by default. SuSe, take a bow.

I agree absolutely about distractions. Another sign of bad manners on behalf of those who wish to force us to pay attention to their tiny minds. We expect this from two year old children but not from the educated adults which advertising agencies and professional web design bureaux supposedly employ.

If social action to reduce these offences is going to have any effect at all, I think what we need to do is to compile "black lists" of sites and demand that ISPs block them on grounds of the offence they are causing (not to mention bandwidth congestion etc.) At least some ISPs seem to be prepared to block kiddie porn content (returning "page not found" instead of "content blocked" in the case of BT) - with the blessing of at least one national government - so why shouldn't offensive advertising be attacked by the same mechanism?

Mandatory filtering

Posted Apr 11, 2005 18:33 UTC (Mon) by Max.Hyre (subscriber, #1054) [Link]

If social action to reduce these offenses is going to have any effect at all, I think what we need to do is to compile "black lists" of sites and demand that ISPs block them [....] At least some ISPs seem to be prepared to block [...] content [...] with the blessing of at least one national government - so why shouldn't offensive advertising be attacked by the same mechanism?

(Yes, I cut out the ``but it's to protect the children'' bits, because filtering kiddie porn is a riddled with false positives and false negatives as any other filtering regime.)

Erm, because all I demand of an ISP is to send bytes I generate, and accept bytes I receive. Period. And I really don't want my government (or anyone else) controlling what I can see.

I want raw, unadulterated bits in both directions. If some folks want filtering, let them opt in to it. I'll leave it as an exercise for the reader to figure where mandatory filtering leads. (I live in the U.S. of A., so this isn't a tin-foil-hat issue; we're already fighting for freedom of speech, electronic and otherwise.)

Blocking popups in FireFox

Posted Apr 19, 2005 4:41 UTC (Tue) by beoba (guest, #16942) [Link]

While I have Java installed, I keep it disabled in the preferences (under Features). If I visit a site that I need it for (the occasional science demo comes to mind), then I manually enable it temporarily. Would be neat if there was an extension with a fast toggle out there, though.

Frame based "Popups"

Posted Apr 8, 2005 3:15 UTC (Fri) by knobunc (subscriber, #4678) [Link]

A technical solution to the problem of "frame based popups" (rather than the social one proposed in the article) would be to use GreaseMonkey to rewrite the page content (see the LWN article http://lwn.net/Articles/128915/).

-ben

Copyright © 2005, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds