The Omni Group Forums

The Omni Group Forums (http://forums.omnigroup.com/index.php)
-   OmniWeb General (http://forums.omnigroup.com/forumdisplay.php?f=8)
-   -   Blocking Macromedia flash based ads (http://forums.omnigroup.com/showthread.php?t=1755)

Mila 2006-09-24 03:57 AM

Blocking Macromedia flash based ads
 
How does one go about blocking MacroMedia flash based ads?

If you put the mouse pointer over one of those ad types, you don't see a URL in the status bar to base your ad block expression on. If you CTRL click on the ad, you see a menu showing 'Settings' and 'about Macromedia FlashPlayer'.

Any suggestions? What would I look for in the source. Anything in particular?

zottel 2006-09-24 11:25 AM

Flash URLs normally end with ".swf", so just put the following in your blocked URLs list:

\.swf$

(Explanation: "." means "any char" in regular expressions, so you have to escape the "." with the backslash. "$" means "end of string".)

Mila 2006-09-24 11:46 AM

Ok. Thanks.

I already picked that part up in the help while waiting for suggestions. :)

I was hoping for a more selective method rather than one that blocks them wholesale.

zottel 2006-09-24 01:42 PM

What do you mean by "more selective"?

You can, of course, always use that template to only block flash ads from a certain server. E.g.: To only block flash from the server some.ad.com, use

some\.ad\.com.*\.swf$

(Explanation: Matches on any URL that contains "some.ad.com" ('.'s have to be escaped), followed by zero or more chars (".*"), followed by ".swf" at the end of the string.)

Or, just to show the power of regular expressions: ;-) If you only want to block flash files that contain "ad" in their filename, you could use:

ad[^/]*\.swf$

That means: Match anything that contains "ad" followed by a char that is not '/' ('[^/]') zero or more times ('*'), followed by ".swf" at the end of the string. You only match the filename itself, since the rest of the URL would contain a '/'. ([] is a character group. [abc] means: "One of the chars a, b, or c." Inside [], '^' means "not". So if you want to match any char that isn't '/', you can use [^/]. That itself would mean "one char that isn't '/'". An '*' means "the item before the '*', zero or more times". "a*" means "zero or more 'a's". "[dgy]*" means "zero or more times a 'd', a 'g', or a 'y'". As '.' means "any char", ".*" means "zero or more times any char". And "[^/]*" means "zero or more times any char, but not '/'".)

Forrest 2006-09-24 09:49 PM

FWIW, I just block images from third-party sites as a whole. Then use the site prefs to disable that block on sites where it doesn't work well. That nails almost all the Flash ads I would normally run across.

Mila 2006-09-25 02:33 AM

Thanks Forrest and Zottel.

Zottel, I'm pretty familiar with regular expressions and was finding my way. I had not used them in a while so you reminded me how to match a everything except a particular character. :) I have created quite a few expressions already.

Forrest, it seems to be a matter of which setup has you doing less selective blocking/allowing on a per-site basis.


All times are GMT -8. The time now is 12:04 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.