Surgical web page editing with “stylish”
Have you noticed that some web sites have ads that are somewhat… unpredictable? Facebook is a good example of this. The ads that appear on the right can sometimes contain trashy-looking content. I’d like to hide them, if I could.
I found a Firefox plugin that does a good job of slicing out selected bits of content. It’s called “stylish“.
Just install the plugin, and then set up a script that intercepts the stylesheet for a particular site and does a little on-the-fly modification. The script I use for Facebook looks like this:
@namespace url(http://www.w3.org/1999/xhtml); @-moz-document domain("facebook.com") { .emu_ad, .UIStandardFrame_SidebarAds, #home_sponsor { display: none !important; } }
I don’t claim to fully understand the script, but I do know that it looks for a specific block in the Facebook HTML and style sheet, and it sets the style for the sidebar ad box to “display: none”. That makes it disappear.
3 comments
Leave a Reply
You must be logged in to post a comment.
It hides elements with defined style class/id.
Stylish is probably a better method of annoying-ad removal than the method I use. Whenever I don’t want ads, I would prefer to not waste *any* resources on them. Computation, bandwidth, time. So, I use my hosts file.
http://www.mvps.org/winhelp2002/hosts.htm
This fella has done a great job for a number of years of marking bad IPs, and so I just use his ~700kB file in place of my own. It’s filled with lines like these:
127.0.0.1 http://www.annoying-ad-server.com
Works like a charm!
Recently, I have had better luck hiding the “adcolumn” class. That is, the line above “display” should read “.adcolumn {“.