mirror of
https://github.com/kou029w/user-script.git
synced 2025-01-18 16:08:04 +00:00
10 lines
293 B
JavaScript
10 lines
293 B
JavaScript
|
// ==UserScript==
|
||
|
// @match https://www.amazon.co.jp/*
|
||
|
// ==/UserScript==
|
||
|
"use strict";
|
||
|
|
||
|
const { pathname } = window.location;
|
||
|
const dp = pathname.match(/(?<=\/(?:dp|gp\/product)\/)\w*/)?.[0];
|
||
|
const to = dp && `/dp/${dp}`;
|
||
|
if (to && pathname !== to) window.history.replaceState(null, "", to);
|