Posts Tagged “proxy”

So why has been talking about MouseHole lately. If you’re unaware, MouseHole is a ruby script that acts as a web proxy and filters HTML documents via ruby scripts. Or for a much better look at it, go look at what why wrote.

Anyway, I wanted a way to do JavaScript cross-site AJAX tricks, like what Greasemonkey enables. Unfortunately, because MouseHole is a pre-processor, not a JavaScript extension, it’s not possible. So I spent a few hours and wrote a way for MouseHole scripts to provide content that doesn’t actually exist (as opposed to mutating existing content). This way JavaScript can do an AJAX call within the same domain (so it doesn’t hit the security limitations) but that call is intercepted by your script, so you could pull info from other sites and send it back, or whatever you wish.

I haven’t actually done anything with this new capability yet aside from a rather silly example script which simply adds a button to Google that asks MouseHole for a random number. I’d really like to extend Google Maps, but that will require delving into how it works, and it’s far too late to do that now, as I need to get to bed.

Anyhow, I put together a patch and sent it to the MouseHole Scripters mailing list. If you check out MouseHole from the CVS repository, you can apply my patch and test it. Or you can just wait to see if it gets added to MouseHole.

Comments Comments Off on MouseHole and JavaScript