I’ve been using IE at work since my company merged with another in January; before then I had been using Firefox, but because we had to unify our IT policies this option was taken away from me. The main things I like about Firefox are the context menu google search (select text, right click, choose ”Search web…” and away you go), and the extension AdBlock, which allows wildcard-based filtering of elements on websites. The former behaviour can be partially compensated for in IE by using bookmarklets, but the latter is a definite loss: my web had been advert-free for so long! However, I’ve now found a solution. I switched to IE7 still during the beta phase, mainly out of interest; tabbed browsing isn’t something I’d consciously missed from Firefox, but I found something about IE7 slightly more usable than IE6. IE7 has a handy feed-reader built in, and one of the feeds you get automatically is IEBlog, where the developers get slated by a bunch of Firefox zealots. One of the articles talked about how wonderful the extensions were going to be in the new IE. You can read the comments for the reality of the situation, however one of the exensions described, Mouse Gestures, piqued my interest when one of the MS guys commented that:
For instance, when I double-right-click, all of the Flash objects and third-party images are removed from the page (handy for reading online newspapers).
Now that sounds like a good compensator for AdBlock! A quick rummage around on GreaseMonkey userscripts found this, a JavaScript that alters the behaviour of flash elements. I pared it back to this:
(function () {
var objects = document.getElementsByTagName("object");
for(i=0;i<objects .length;i++)
{
var flash = objects[i];
if(flash.innerHTML.match(/.swf|shockwave|flash/))
{
flash.on = false;
flash.style.display = 'none';
}
}
})();
With this saved as a .js file, I then associated it with double-right-click in mouse gestures, and BANG! The flash ads were gone. Of course, it doesn’t work all the time, for example the Guardian website serves its adverts in an iframe using JavaScript, which is resistant to this method. Also, the old favourite of animated gif banner ads aren’t affected. If I feel arsed enough I could write some more JavaScript to take care of these exceptions, but for the moment I’m happy.





