Internet radio is becoming more and more popular, and one of the more popular ones is Grooveshark. These free websites are ad-supported, but sometimes you want to maximize your screen real estate and only see the radio player UI. This is a quick tutorial of how to hide the ads on the right side of the screen on Grooveshark.
Update 6/20/2010: Grooveshark seems to have made some updates and the original script does not work. I’ve updated my script to reflect their changes and it works again.
Below is what Grooveshark looks like by default. I’ve highlighted the area on the right dedicated to ads.
We are going to hide the ads by running a bit of Javascript to manipulate the page’s DOM. The script we are going to run is:
javascript:function a(){document.getElementById('sidebar').style.display = 'none'; document.getElementById('mainContentWrapper').style.marginRight = '0px';}; a();
Depending on your screen size, the above code may be on multiple lines, but for the script to work, it needs to be one single line of code. Basically what it does is hide the div which contains the ads and then sets the right margin of the div which contains the main content to zero, making it take up the entire width of the screen.
How can you run the above Javascript on the page you ask? All modern browsers allow you to run Javascript directly from the address bar. On the page you are wanting to run it on, just replace the URL with the Javascript you wish to run, and press enter.
So for this particular example, these are the steps to start up Grooveshark and hide the ads:
- Open your browser
- Navigate to http://listen.grooveshark.com/
- Copy the Javascript above (make sure it’s all one line! If it’s not, paste it into notepad and take any line breaks out)
- Paste the Javascript into the address bar (make sure to REPLACE the current URL)
- Press Enter. You’re done!
You can actually run this Javascript at any point, so if you’ve been listening to Grooveshark for a while and suddenly decide you don’t want the ads anymore, just run the Javascript on the page and presto, they’re gone! There is no need to close the browser/tab and reopen it fresh.
This concludes the quick tutorial of how to hide the Grooveshark ads. This concept can be used on most websites, so if you are somewhat familiar with Javascript and the DOM, you can use this technique to manipulate any website you want.




Ahah, I was just going to write a JS line to do this thing and then I thought: “maybe someone has already done it!” … BINGO!
Thanks, M
I know this is pretty dated, but i just changed the element id tags and used this same concept.. so this works very nicely for now
javascript:function a(){document.getElementById('capital').style.display = 'none'; document.getElementById('application').style.marginRight = '0px';}; a();all one line executed from address bar still!
cheers