Skip to content

Instantly share code, notes, and snippets.

@darkhelmet
Created August 1, 2012 04:58
Show Gist options
  • Save darkhelmet/3223827 to your computer and use it in GitHub Desktop.
Save darkhelmet/3223827 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Amazon Canonical
// @namespace http://verboselogging.com/
// @version 0.1
// @description Make the main title of an Amazon product page a link to the canonical URL of the page.
// @match http://*amazon*/*
// @copyright 2012+, Daniel Huckstep
// @require https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
// ==/UserScript==
var canonical = $('link[rel="canonical"]').attr('href');
var span = $('#btAsinTitle');
span.replaceWith($('<a href="' + canonical + '">' + span.text() + '</a>'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment