While writing a Chrome extension to control Grooveshark, I was excited to find out they offered a javascript API, but that excitement quickly faded when I realized Chrome’s sandbox wouldn’t let me touch it. The existing solution to this is to create script tags and inject them into the page. This works, except it’s a little messy, and doesn’t work for any function with a return value.
I wrote a quick proxy that mirrors their api, using the ‘GroovesharkProxy’ object instead of the ‘Grooveshark’ object.
Instead of
window.Grooveshark.next();
you call
GroovesharkProxy.next(); // from your extension’s content script.
You can still call any of the methods they support, and even get return values. If anything’s broken let me know (or submit a patch!).
Find it here: https://github.com/msfeldstein/Grooveshark-Chrome-Extension-Proxy

