Posts Tagged “javascript”

If you’re like anybody else that I know, you were rather shocked and appalled to see Google follow the likes of Bing and add background images to their home page. If you’re also like anybody else that I know, you’re aware that Safari 5 was released with support for extensions. And if you’re like me, you thought that the new extensions behavior might be a great way to, erm, “fix” Google. Inspired by a tweet from @rentzsch, I decided to figure out how this might be done. I am, of course, not a JavaScript programmer, and Google’s front page code is quite obfuscated, but after playing around with it for a bit over an hour, I got something that worked. Unfortunately it also has the side-effect of blocking the fairly nice fade-in of all the text content, and it’s also a bit fragile, but if you absolutely cannot stand the background image, feel free to download the extension and try it out.

Update: I played around for a few more hours and got something much better. It’s still fragile, but not nearly so much as before, and it restores the fade effect for all the google content. Same download link as before.

Update 2: Looks like Google fixed their homepage sometime this morning, so this extension is now officially obsolete. I will continue to host the download if anybody is interested in the code.

Comments Comments Off on CleanGoogle Safari extension

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