Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Getting Amazon short URL
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..')
})
})()
@captain-blue210
Copy link
Author

captain-blue210 commented Jan 20, 2021

Usage

Add a new bookmark and paste the script in the URL.

Notice

I only confirmed that it works in Chrome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment