Created
January 20, 2021 02:15
-
-
Save captain-blue210/0ec01afa1356b1cb5eca04b5f39c1319 to your computer and use it in GitHub Desktop.
Getting Amazon short URL
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 () { | |
const title = document.title.split('|')[0].trim(); | |
const url = `https://www.amazon.co.jp/dp/${ue_pti}`; | |
const markdown = `[${title}](${url})`; | |
navigator.clipboard.writeText(markdown).then(function () { | |
alert(`URL Copied! : ${markdown}`); | |
}, function () { | |
alert('URL Copy failed..') | |
}) | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage
Add a new bookmark and paste the script in the URL.
Notice
I only confirmed that it works in Chrome!