Skip to content

Instantly share code, notes, and snippets.

@iamdanw
Forked from Srikanth-AD/bookmarklet-canonical-url
Last active December 29, 2016 18:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iamdanw/a750c305e9813dde34c793e4beeea357 to your computer and use it in GitHub Desktop.
Save iamdanw/a750c305e9813dde34c793e4beeea357 to your computer and use it in GitHub Desktop.
Bookmarklet - visit canonical URL of current page
javascript: (function(){var e=document.location;var t=document.getElementsByTagName("link");var n=window.location+"";for(var r=0,i;i=t[r];r++){if(i.getAttribute("rel")=="canonical"){n=i.getAttribute("href");break}}window.location=n})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment