-
-
Save razz0408/f839ee34432edb15d8829e902d582cbd to your computer and use it in GitHub Desktop.
amazonのURLを短縮するgreasemonkeyスクリプト cf.http://d.hatena.ne.jp/Cherenkov/20080907/p1
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
// ==UserScript== | |
// @name amazon_short_url | |
// @namespace amazon_short_url | |
// @include https://www.amazon.co.jp/* | |
// ==/UserScript== | |
(function(){ | |
const asin = document.getElementById('ASIN'); | |
const title = document.getElementById('title_feature_div'); | |
if(asin){ | |
const link = document.createElement('a'); | |
const url = 'https://www.amazon.co.jp/dp/'+asin.value; | |
link.setAttribute('href', url); | |
link.appendChild(document.createTextNode(url)); | |
const add = document.getElementById('centerCol'); | |
add.insertBefore(link, title); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment