Lately I've been listening to Pandora as background noise while coding. Like you, I've clicked the "I'm still listening" button more times than I'd care too. Today I decided to do something about it; I'm not talking about paying to upgrade Pandora either.
I'm sure someone out there has already written a perfectly good Greasemonkey script that I could use, but where is the fun in that. It has been a while since I wrote anything in JavaScript so I figured this would be a great opportunity to clear away any cobwebs.
The first thing that needs to happen is to be notified of any changes to the DOM. This is quite easy using MutationObserver defined in the DOM4 specification. The callback is provided with a MutationRecord that contains the addedNodes as a property. We can then search the addedNodes for the "I'm still listening" button.