Okay, so I feel a bit stupid for not having noticed this before. I wanted to geo-tag my blog in FeedBurner and so flicked to Google Maps to work out the latitude and longitude of the head office of the company at which I work.

I found a quick guide on how to extract lat/long information from Google Maps on the Tech-Recipes site, which suggested centring[1] the map and then copying and pasting the following JavaScript code snippet into the browser's address bar:

javascript:void(prompt('',gApplication.getMap().getCenter()));

For the record, the code works, but that's not what caught my attention. The code runs, but the part that was new to me is that the code runs in the context of the current browser window and has access to all its variables. I'd never realised that before, hence why I now feel stupid.

Nonetheless, it means that I now have a quick way of executing arbitrary JavaScript when I want to poke around on a page but don't want to fire up a debugging tool.

Oh, and yes, jQuery expressions do work, but watch out for characters requiring escaping in your selectors.

[1] I'm Australian. That's correct spelling. So there :)