Pages

Wednesday, January 13, 2010

Inspect Element

I work in the online ad industry, and while you may hate even looking at the banner ads, I am often tasked with finding out who is running that banner ad. With aggregators, meta-aggregator, networks and exchanges, it is increasingly difficult to tell who is running on which site, and you need to check.

You can always hover/click on the ad and hope to be able to be fast enough to notice the redirect, but this would often not work with flash content/javascript based clicks. Or you can run a monitoring tool like Firebug or HttpWatch and look at the http request/response for that page, it is too clumsy - Firebug is painfully slow to have it running all the time, so running it means one has to refresh the page after the ad has been loaded. I usually find the 'Inspect Element' option (shown when you right click) very handy. It lets you inspect the page source (not the static source but the generated one, in all its glory, and takes you right away to the element of interest, under the hood. Like all good things, it is a Firefox only option, and one of the things that ensured I couldn't really switch from Firefox to Camino or Safari even when I want to.


The good news is, this option is available on Safari too, although it is hidden. To enable it, fire up a terminal window and issue this command


defaults write com.apple.Safari WebKitDeveloperExtras -bool true

That's it. When you restart Safari next, you would see the Inspect Element option when your right click anywhere on page, and should you exercise that option, you would be greeted with a pane like the one below


No comments: