Last active
January 27, 2024 10:52
-
-
Save td2sk/4a7ed5f022949248dbd0ea076fd66fcf to your computer and use it in GitHub Desktop.
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
// ==UserScript== | |
// @name Redirect for akizuki catalog | |
// @namespace http://tampermonkey.net/ | |
// @version 2024-01-26 | |
// @description Redirects from the old akizuki product page to the new one. | |
// @author td2sk | |
// @match https://akizukidenshi.com/catalog/g/*/ | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=akizukidenshi.com | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
const pattern = /^https:\/\/akizukidenshi\.com\/catalog\/g\/g[a-zA-Z]-([0-9]+)\/$/; | |
const url = document.URL; | |
const m = url.match(pattern); | |
if (!m) { return; } | |
const newUrl = `https://akizukidenshi.com/catalog/g/g1${m[1]}`; | |
window.location.href = newUrl; | |
})(); |
This script is no longer needed because the redirect setting has been added to the website itself.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This code is licensed under CC0.