532236728qq.com / Wowhead Redirector

// ==UserScript==
// @name         Wowhead Redirector
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Redirect to the CN version of Wowhead Classic pages
// @author       Taka
// @match        https://www.wowhead.com/classic/*
// @grant        none
// @run-at       document-start
// @license      MIT
// ==/UserScript==


(function() {
    'use strict';

    const path = window.location.pathname;
    const isClassic = path.startsWith('/classic/');
    const isNotCN = !path.includes('/classic/cn/');

    if (isClassic && isNotCN) {
        const newPath = path.replace('/classic/', '/classic/cn/');
        const newUrl = window.location.origin + newPath + window.location.search;
        window.location.replace(newUrl);
    }
})();