Last active
December 11, 2015 02:58
-
-
Save tarot/4533934 to your computer and use it in GitHub Desktop.
Amazonの商品ページのURLを短くするBookmarklet
This file contains 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
javascript:(function(){var asin,_,_ref;_ref=location.pathname.match(/(?:\/dp\/|\/gp\/product\/|\/asin\/)([^\/]+)/i),_=_ref[0],asin=_ref[1];if(asin!=null){return history.replaceState("","","/dp/"+asin+"/")}})(); |
This file contains 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
do -> | |
[_, asin] = location.pathname.match /(?:\/dp\/|\/gp\/product\/|\/asin\/)([^\/]+)/i | |
history.replaceState '', '', "/dp/#{asin}/" if asin? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment