-
-
Save rondevera/1306958 to your computer and use it in GitHub Desktop.
Amazon short URL bookmarklet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(d){ | |
var asin = d.getElementById('ASIN'), url; | |
if (asin) { | |
url = 'http://' + d.domain + '/dp/' + asin.value; | |
if (prompt('Short Amazon URL (hit OK to load):', url)) { | |
window.location.href = url; | |
} | |
} else { | |
alert("Can't find an Amazon product ID."); | |
} | |
}(document)); | |
// Bookmarklet: | |
// javascript:(function(d){var asin=d.getElementById('ASIN'),url;if(asin){url='http://'+d.domain+'/dp/'+asin.value;if(prompt('Short Amazon URL (hit OK to load):',url)){window.location.href=url;}}else{alert("Can't find an Amazon product ID.");}}(document)); | |
// Alternative bookmarklet generator: | |
// http://ted.mielczarek.org/code/mozilla/bookmarklet.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This version adds support for: