Copy Lyrics in Pandora to Clipboard

Today I wanted to follow along in the lyrics with a tune I was enjoying on Pandora, so I searched for the last word in the song I heard. The browser scrolled to the section of the song where the word was located, however, the word was not highlighted. I tried to select the lyrics, and was annoyed to find the lyrics were not selectable. It was then time for a little JavaScript magic to make it possible to select, copy, and paste the lyrics.

Fortunately, the Pandora website uses jQuery, which makes it stupid easy to re-enable the ability to select & copy the lyrics in a single statement. If you want to do the same, just drag this bookmarklet to your bookmark bar:

Copy Pandora Lyrics

Here’s the JavaScript code that makes this possible:

$("div[class^='lyricsText']").attr({
	class: "lyricsText", 
	unselectable: "off", 
	onmousedown: null, 
	onclick: null, 
	ondragstart: null, 
	onselectstart: null, 
	onmouseover: null
});

All it does is find the <div> tag in the HTML that contains the lyrics and disables all the things that disable the selection of the lyrics text. That’s a lot of disabling! Put another way, it re-enables the selection of they lyrics. :)

About GeekLad

Geeklad is a technology enthusiast and programming hobbyist. Occasionally he will put together useful little bits of code (be it JavaScript or PHP) and share them with the world. He also enjoys creating and sharing howtos, describing how to do the things people want to do with their computers.
Tagged . Bookmark the permalink.
  • Clark Jason

    A Few years ago, I read a fascinating book called The Tipping Point, written by Malcolm Gladwell.The story of the first Claddagh Ring would make a wonderful romance novel or an unforgettable film. It would stand as a testament to the power of love and faithfulness.Romantic Status
     

  • http://www.facebook.com/profile.php?id=503818307 Yakov Hadash

    Doesn’t work as of 6/2012

  • Cory K

    or if your in chrome, you can right click anywhere on the lyrics -> inspect element -> double click where it says “class=”lyricsText unselectable”" -> and rename the “lyricsText unselectable” to anything you want i.e. “asdf” then hit enter :-)

  • test

    that’s not enough

    However, found another bookmarklet written by Karl Tatom (http://themusikid.blogspot.com/2012/03/bookmarklet-to-make-pandora-lyrics.html) which worked in Firefox after also modifying the style attribute:

    javascript:(
    function(){
    if (location.href.indexOf(‘pandora’) !== -1) {
    var divs = document.getElementsByTagName(‘div’);
    var div;
    var divClass;
    var i = 0;
    var numHad = 0;
    for (i = 0; i 0) {
    alert(‘Made ‘ + numHad + ‘ tags selectable! :D’);
    }
    } else {
    alert(‘This is not Pandora!’);
    }
    }
    )()

  • S.Nkm

    No need for coding, just fire up Firebug, click on the Lyrics section with the “inspect” tool, open the selected DIV element, copy and paste.

    Seriously why do they even bother with that stuff?

  • Milad Heydari