A Bookmarklet to Enable All Text Selection

If you installed this bookmarklet before June 28, 2016, you should re-install your bookmarklet and update to the latest version, which works on more websites and defeats more strategies that prevent text selection and copy/paste. It also no longer depends on jQuery, which will improve reliability even further. Big thanks to RoxKilly for your contribution!

I have noticed at least one lyrics website has started preventing users from copying lyrics. (As if the lyrics website has a copyright on someone else’s song lyrics!) While there are some good user-experience reasons to disable text selection for certain parts of a web app, but clearly entire the point of a lyrics website is to look up lyrics — and selecting lines can make it easier to read in your browser, or perhaps you want to paste the lyrics into an MP3’s ID3 data (“Get Info” in iTunes).

So screw that.

Here’s a bookmarklet that should allow you to select anything on a web page. It’s not an ultimate solution, but it works for me. Just click it on an offending page.

Allow Text Selection

Install it by dragging the above bookmarklet to your browser’s bookmarks bar, or by copying its target and pasting it as a new bookmark.

Then go try it out at an offending lyrics site or this test page (the latter affects Safari/Chrome/Firefox only, currently).

Or, if your system displays this symbol (a mathematical, serif, capital letter I, reminiscent of a text-selection I-beam cursor), I think it makes for a neater bookmarklet:


More Bookmarklets

You can see even more of my little bookmarklets here. I hope some prove useful!

The Code

The script works by disabling JavaScript that intercepts the user’s mouse clicks and selections, and by removing a CSS property that prevents selection.

It is quite possible that this script won’t work on some pages. Don’t send nasty comments if this turns out to be true, but bug reports are welcome.

The source code for this bookmarklet is available on GitHub.

January 24th, 2011. (Updated: April 02, 2015 at 9:22pm.)
Alan Hogan (@alanhogan).  Contact · About