Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Block an annoying Javascript that affects Copy/Paste Web Browsers
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:
  • In Finder, from the Go menu, choose Go to Folder...
  • In the 'Go to the folder' dialog, type /etc/.
  • From the /etc/ folder window, open the 'hosts' file in your favorite text editor.
  • Add the following to the hosts file in its own line at the end of the file, using the site that applies to you (Tynt in this case):
  • 127.0.0.1 tcr.tynt.com
  • Save and quit. You may be asked to authenticate with your admin password to do this.
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.]
    •    
  • Currently 2.50 / 5
  You rated: 2 / 5 (16 votes cast)
 
[9,423 views]  

Block an annoying Javascript that affects Copy/Paste | 22 comments | Create New Account
Click here to return to the 'Block an annoying Javascript that affects Copy/Paste' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Block an annoying Javascript that affects Copy/Paste
Authored by: VesperDEM on Jun 01, '10 08:20:29AM

This is weird. When I attempt copying text from the sites mentioned in Daring Fireballs article, the pastes work as expected. No attribution appendages at all.

Now, I do have ad blocking on my computer. I use Glimmer Blocker and I also use Glims with Safari. Still, I wouldn't expect those to cripple this javascript on those sites.

Even in Firefox and Opera, I don't get anything unusual when I copy and paste text.

Maybe I'm missing something here, but I'm not seeing this problem. At least not when pasting.



[ Reply to This | # ]
Block an annoying Javascript that affects Copy/Paste
Authored by: Unsoluble on Jun 01, '10 08:39:28AM

How much text did you select? Depending on the site, they'll only append the "read more" garbage if you've selected more than a certain amount.



[ Reply to This | # ]
Block an annoying Javascript that affects Copy/Paste
Authored by: PatrickS on Jun 01, '10 09:22:42AM

*.tynt.com is part of GlimmerBlocker's "Ad-networks" rule set.



[ Reply to This | # ]
Block an annoying Javascript that affects Copy/Paste
Authored by: fuyutsuki on Sep 16, '10 08:08:33AM
Looks like Tynt is at it again. I don't run Safari 5, but I do run GlimmerBlocker. *.tynt.com is blocked, and yet Tynt was wreaking havoc here: http://blogs.myspace.com/index.cfm?fuseaction=blog.view&friendId=96899187&blogId=539165330 Yes, MySpace (sigh) but I love that show and frequently copy text out of the playlists hosted here. Needless to say Tynt is unbearable. So here's what I found in the source:
{"url":"http://js.myspacecdn.com/modules/common/static/js/atlas/richtexteditor_uvm5sqtf.js","test":"punymce.Editor"},"tracking/tynt.js":{"url":"http://js.myspacecdn.com/modules/common/static/js/jquery/tracking/tynt_zcvgeagv.js?user=bjNOt4bfyr35kFadbiUt4I&lang=en","test":"startTyntApp"}})
I'm no HTTP / CSS coder, but tynt showed up several times, all grouped together, yet doesn't mention tynt.com so managed to avoid my filter. Looks like MySpace is hosting it for them. So, for now, I blocked all queries containing "tracking" in their path. That's keeping it at bay for now, but I expect Tynt to try again.

[ Reply to This | # ]
Block an annoying Javascript that affects Copy/Paste
Authored by: robJ on Jun 01, '10 08:23:40AM

I didn't want to muck with my hosts file so I added tynt.com to the blocked sites in Trend Micro Smart Surfing and it blocks the javascript code quite effectively.



[ Reply to This | # ]
Block an annoying Javascript that affects Copy/Paste
Authored by: arkayn on Jun 01, '10 08:38:19AM
I normally edit my hosts file with Textedit, but you have to do it via root.
sudo /Applications/TextEdit.app/Contents/MacOS/TextEdit /etc/hosts
That opens Textedit with root powers. Of course I also use Noscript on Firefox so do not see those things normally.

[ Reply to This | # ]
Block an annoying Javascript that affects Copy/Paste
Authored by: jimothy on Jun 02, '10 07:53:14AM
There's a shorthand version of that:
sudo open -e /etc/hosts
"open -e" means "open with TextEdit"

[ Reply to This | # ]
Block an annoying Javascript that affects Copy/Paste
Authored by: tempel on Jun 01, '10 08:44:20AM

The generally useful "Little Snitch" firewall extension can be used as well to block any access to this site, I reckon.



[ Reply to This | # ]
Block an annoying Javascript that affects Copy/Paste
Authored by: EldRick on Jun 01, '10 09:27:43AM

You can also use Glimmerblocker and create a Filter to eliminate tcr.tynt.com

What? You don't use Glimmerblocker? Really?



[ Reply to This | # ]
Block an annoying Javascript that affects Copy/Paste
Authored by: gklinger on Jun 01, '10 09:29:16AM
Alternately, you could just use Tynt's opt-out feature which you can find here.

[ Reply to This | # ]
Block an annoying Javascript that affects Copy/Paste
Authored by: Anonymous on Jun 01, '10 02:21:25PM

Well that's fair enough if you want them to know you've opted out. Privacy anyone?



[ Reply to This | # ]
Block an annoying Javascript that affects Copy/Paste
Authored by: asmeurer on Jun 01, '10 06:26:15PM

I think it just sets a cookie in your browser.



[ Reply to This | # ]
Block an annoying Javascript that affects Copy/Paste
Authored by: saulgold on Jun 01, '10 09:42:49AM

You can also just opt out of the Tynt service: http://www.tynt.com/support/opt-inout/



[ Reply to This | # ]
Block an annoying Javascript that affects Copy/Paste
Authored by: hughescr on Jun 01, '10 10:28:14AM

Or, just opt out:

http://www.tynt.com/support/opt-inout/



[ Reply to This | # ]
Block an annoying Javascript that affects Copy/Paste
Authored by: Anonymous on Jun 01, '10 02:24:31PM

"Block an annoying Javascript"...

Should be "Block an annoying Javascript script".

Otherwise it'd be okay to say "Install an Objective-C".



[ Reply to This | # ]
Block an annoying Javascript that affects Copy/Paste
Authored by: barefootguru on Jun 01, '10 04:28:04PM

Not at all. The word 'script' is already in the name so saying it again is redundant.

'I'm writing a JavaScript script' just sounds stupid.

And it's a capital 'S'.



[ Reply to This | # ]
Block an annoying Javascript that affects Copy/Paste
Authored by: TGB on Jun 01, '10 07:49:31PM

JavaScript is not a single, definitive, tangible item. It's an adjective because it describes a type of code. You can have a JavaScript engine, JavaScript implementation, JavaScript error, and so on. "I have a Facebook" is patently wrong in the exact same way, since you can have a Facebook page, Facebook account, Facebook message. Just because a noun is included in the construction of a proper noun doesn't make nouns that follow redundant. "ATM machine" is redundant because "machine" as the noun appears in both the acronym and the construction, however JavaScript qualifies the noun of "script".



[ Reply to This | # ]
Block an annoying Javascript that affects Copy/Paste
Authored by: robertcoogan on Jun 01, '10 05:31:16PM

I just tried this using the links provided and did not see anything other pasted than what I copied. Tried pasting into a new Mail message, TextEdit, and MS Word. Nothing other than what I copied appeared.



[ Reply to This | # ]
Block an annoying Javascript that affects Copy/Paste
Authored by: afb on Jun 01, '10 05:57:13PM

This is another great reason to use OmniWeb. Just add tynt.com into the blocked URLs list and it ceases to work. No mucking around with the hosts file, and you can even reenable it for certain sites if you wanted to.



[ Reply to This | # ]
AdBlock Plus
Authored by: TGB on Jun 01, '10 07:29:43PM

Just add *.tynt.com to your AdBlock Plus, Safari AdBlock or similar browser plugin, rather than screwing around with system files.

I just went to the New Yorker link that Gruber provided as an example, opened blockable items, found tynt.com and blocked the entire domain. Same thing in Safari AdBlock. Problem solved.



[ Reply to This | # ]
Block an annoying Javascript that affects Copy/Paste
Authored by: conundrum on Jun 03, '10 08:39:14AM

I use NoScript in Firefox and it, by default blocks tynt.com, so no problem with copy and paste here. But good hint to know when I use Safari.



[ Reply to This | # ]
An Easier WayÖ
Authored by: jscotta on Jun 08, '10 01:29:48PM

There is a easier way if you are running your Safari with the Developer mode turned on. Just check the "Disable Javascript" option. Problem solved.

---
Windows because I have to. OS X because I want to.



[ Reply to This | # ]