Neil Turner's Blog

Blogging about technology and randomness since 2002

Stopping Google Autolink

Here’s something that will please some peoplea piece of JavaScript that prevents Google’s Autolink feature from working (Autolink is a feature of the new Google Toolbar Beta – see previous discussion). Basically, whenever the user hits the Autolink button, the script removes the link.
I’ve put an example script with the JavaScript code here. The example includes an ISBN number which is both shown as a link to Amazon.co.uk and unlinked. Normally, when you hit the Autolink button, the unlinked number would become a link, but the JavaScript stops this from happening. The linked ISBN number remains unchanged.
There are two potential pitfalls with this method, however. The first is that a list of found ISBN numbers will still be visible by clicking the arrow next to the Autolink button. Arguably I think this is a good compromise – the toolbar isn’t modifying the page but is still helping the user, and perhaps future releases of the toolbar will make do with this compromise. The second is that if the user has disabled JavaScript, the script will become useless and Autolink will work as Google intended.
Jeffrey Zeldman has already rolled this script out on his own site and on A List Apart. I haven’t, as I promised in my previous article (other than that test page) and at present have no intention of changing that position. I still think this is a useful feature but Google may need to compromise to protect its integrity amongst webmasters.
Update: Here’s a bookmarklet to defeat the Javascript code.

5 Comments

  1. I like Zeldman’s scare mongering title, “Protect your site from Google’s new toolbar”. And some of his reasoning is a bit… flawed. Apparently it lets the company “edit” your page without your knowledge. The thing is, it’s only client-side. The change isn’t saved on the original.
    And, to be honest, the author puts the page on the web to be viewed by everyone. If Zeldman doesn’t want you to be able to edit his page(s), he should take his site off the internet rather than crying about it.

  2. So Steve, am I to assume you had no problem when Microsoft wanted to introduce Smart Tags? Personally I don’t like this one bit and your analogy is flawed.
    Putting something online doesn’t automatically entitle poeple to do what they want with it. Ever heard of copyright? If Google Autolink started adding in affiliate links would you still be happy?
    It’s a slippery slope.

  3. There’s nothing you can do to stop client side editing though 😉
    If I used IE, I would use a Proxomitron filter to strip out this javascript, so that the links worked.
    JS or not, you can’t stop someone from filtering your HTML if they want to 🙂

  4. Zeldman and A List Apart are examples of sites which still include the meta tag to block Smart Tags, even though, as I’ve said previously, MS never officially released a browser based on that technology. Furtheremore, the current implementation of Autolink would only affect one ISBN number on A List Apart (as Phil Ringnalda put it so well) – bearing in mind the extra bandwidth that the script will generate it hardly seems worth it.
    With regards to the legalities, in the case of this site I permit derivative works based on my content so there’s no legal issues at all with Google modifying my content (AFAIK).
    But with the rest of the web it’s still a legal grey area. If I were Google I might consider dropping the part of Autolink that modifies page content just simply to stop the FUD against them, and instead replace it with a menu that is shown when you click the button.

  5. I’ve written a rather lengthy rant about this issue on my blog that you or (your readers) might be interested in. Although I raises few points that haven’t been voiced elsewhere, I’ve also posted a script that [removes the malarkey](http://evirtus.net/default.asp?82;Google-malarkey) (and fixes a couple of issues with the script that’s currently “floating” around.). Also some info on what’s being modified and how to “capture” it…