user-script/amazon-shorten.user.js

9 lines
253 B
JavaScript
Raw Normal View History

2022-04-22 21:26:36 +09:00
// ==UserScript==
// @match https://www.amazon.co.jp/*
// ==/UserScript==
"use strict";
const { pathname } = window.location;
2023-04-13 11:02:51 +09:00
const dp = pathname.match(/(?<=\/dp\/|\/gp\/product\/)\w*/)?.[0];
if (dp) window.history.replaceState(null, "", `/dp/${dp}`);