Closed Bug 226501 Opened 19 years ago Closed 19 years ago

RFE: A better way to block stuff


(Core :: Networking, enhancement)

Not set





(Reporter: jonwil, Assigned: darin.moz)


The idea I have is basicly a simple form of expression where you enter in
experssions like* or* or */ads/* or
whatever into a config somewhere.
Then, anytime that a web URL is retrieved, it checks against the list. If it
matches (where * means any characters), it will return a flag that tells the
upper layers to do something appropriate.
If the URL is the main URL (i.e. its in the URL bar, perhaps it was a link that
was clicked on), print an error.
If its a sub-url (such as an EMBED, an OBJECT, an IFRAME or an IMG), it will
silently ignore it (perhaps there could be a visible warning like when a popup
is blocked, with an option to remove the item from the blocklist.

This new feature would cover images, flash files, sound files, IFRAMEs and
anything else.

Naturally, lists of things to add to the blocklist would probobly start
spreading around.

This could be used to block ads or whatever else (for example, do *.wav to block
anything with a .wav extention)
The feature already exists. It's called your hosts file. Google for it. Several
 sites have them ready configured with hundreds of offensive hosts for ads and
other trash. Hosts simply redirects requests for such trash back to your own
machine, either or
Image-blocking with expressions is bug 78104
General media-blocking by site is bug 94035
Discussions about blocking with regular expressions popped up a bit everywhere,
so there's no real bug to link this one too (and we have far too many bugs
anyway). So I'm duping this against 78104. When that's implemented, the other
media types will follow.

*** This bug has been marked as a duplicate of 78104 ***

*** This bug has been marked as a duplicate of 78104 ***
Closed: 19 years ago
Resolution: --- → DUPLICATE
A host-file couldn't be used, becuase that only blocks servers (although it
works for the first example). The reporter wants to use expressions for urls too.
Hacking your hosts file is a bad idea.
You need to log in before you can comment on or make changes to this bug.