Block an annoying Javascript that affects Copy/Paste

Jun 01, '10 07:30:01AM

Contributed by: crarko

Rob Griffiths points out this article: Tynt, the Copy/Paste Jerks by John Gruber, as a solution to an annoying web site 'feature.'

Here's a brief description:

'Over the last few months I’ve noticed an annoying trend on various web sites, generally major newspaper and magazine sites, but also certain weblogs. What happens is that when you select text from these web pages, the site uses JavaScript to report what you’ve copied to an analytics server and append an attribution URL to the text.'

Please refer to the linked article for more background. The following is derived from that article.

The relevant portion for us is: How to block Tynt on a Mac.

If you use Chrome, you can install this Tynt-blocking extension, which does just what it says on the tin. However, you wind up getting a dialog box each time you encounter a different site using Tynt. (Although only once for each site.)

What I’ve chosen to do is edit my /etc/hosts file to block access system-wide to the tcr.tynt.com server. This is the server from which the Tynt JavaScript code is served to all its 'partners'.

Making changes to the hosts file requires administrator privileges, for obvious reasons. If you’re not completely comfortable making changes to an essential Unix configuration file, don’t. This Lifehacker article by Gina Trapani has a good overview of where to find and how to edit your hosts file on Mac OS X or Windows. (TextWrangler is a fine tool for this kind of text editing, and allows you to save files with admin privileges.) Here's how to edit the hosts file:

After saving the hosts file, Tynt’s clipboard-altering nonsense is disabled on all Tynt-using websites I’ve encountered, no matter which browser I use.

[crarko adds: I tested this, and it works as described.]

Comments (22)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20100601064945832