Uninterrupted Sirius Stream - Greasemonkey for IE
November 17th, 2007
Introduction
I’ve been a fan of satellite radio for a few years now. When we opened the doors to our lab space, it wasn’t after the first computer was plugged in that we had Sirius radio streaming.Recently Sirius rolled out an updated version of their web-based player with the introduction of a timeout feature. Every few hours your have to click on the window to continue listening. Let’s see if we can’t get rid of this new feature for a click-free listening experience that will last all day long.
For those already familiar with tools like Greasemonkey this example is trivial; however, if you have never played with client-side javascript tweaks it might be worth a look. If you are a developer writing production javascript, this just reinforces the public nature of content or logic you send client-side.
Greasemonkey was designed as a plugin for Firefox and there are hundreds of scripts available through userscripts.org. The plugin allows you to query/add/modify web content via javascript as you see fit.
We’re pretty much a Firefox shop at assaydepot, but Sirius is something I’ve always played through IE. It used to be the case that only IE was supported although that’s no longer true. One reason I justify leaving Sirius on IE is the frequent restarts I usually make with Firefox during the week. With a few dozen tabs, Firebug, and who knows that else running Firefox has a habit of getting a little out of control with its memory usage. Restarting Firefox doesn’t interrupt my IE listening experience :)
There is a Greasemonkey for IE adaptation that is somewhat different from the Firefox version, but nonetheless effective. That’s what I used for this project.
The Fix
A quick look at Sirius’s javascript shows the use of a timeoutwindow.setTimeout("isUserStillListening()", stillListeningTimeout);
...
function isUserStillListening() {
...display a div and require user-interaction to continue listening...
}
This callback displays a hidden div that the user then clicks on. My first hack checked the display style attribute of this timeout div, if inline it then clicked on the div continuing playback. I then woke up and just overrode the callback with a null function that leaves the player running. GM4IE scripts are executed at the end of the page – sirius sends a full featured function that GM4IE overwrites with nothing at the end of the page.
function isUserStillListening(){}
That’s it. To install this one line of js I installed GM4IE, created a GM4IE config file and the javascript file with this function.
The GM4IE script installer from File didn’t work right for me so I manually edited the extention.list and whella – uninterrupted tunes once again!



Leave a Reply