Skip to content

Instantly share code, notes, and snippets.

@defaultcf
Last active September 6, 2021 13:57
Show Gist options
  • Save defaultcf/6213f6e2bad99a2be8d587e2322823e3 to your computer and use it in GitHub Desktop.
Save defaultcf/6213f6e2bad99a2be8d587e2322823e3 to your computer and use it in GitHub Desktop.
Make Amazon URL shorter
// ==UserScript==
// @name Amazon URL Cutter
// @namespace https://default.cf/
// @match https://www.amazon.co.jp/*/dp/*
// @grant none
// @version 1.0.1
// @author defaultcf
// @description Make Amazon URL shorter
// ==/UserScript==
/*
* https://www.amazon.co.jp/%E3%82%BC%E3%83%AD%E3%81%8B%E3%82%89%E4%BD%9C%E3%82%8BDeep-Learning-%E2%80%95Python%E3%81%A7%E5%AD%A6%E3%81%B6%E3%83%87%E3%82%A3%E3%83%BC%E3%83%97%E3%83%A9%E3%83%BC%E3%83%8B%E3%83%B3%E3%82%B0%E3%81%AE%E7%90%86%E8%AB%96%E3%81%A8%E5%AE%9F%E8%A3%85-%E6%96%8E%E8%97%A4-%E5%BA%B7%E6%AF%85/dp/4873117585/ref=hogehogehoge
* ↓
* https://www.amazon.co.jp/dp/4873117585
*/
window.addEventListener('DOMContentLoaded', () => {
history.replaceState(null, '', `/dp/${ASIN.value}`);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment