Sleazy Fork is available in English.

南+ 自动跳转主站桌面版

自动跳转至主站桌面版

// ==UserScript==
// @name         南+ 自动跳转主站桌面版
// @description  自动跳转至主站桌面版
// @namespace    https://greasyfork.org/zh-CN/users/948411
// @version      1.0
// @author       Moe
// @license      MIT
// @match        https://www.south-plus.net/*
// @match        https://www.east-plus.net/*
// @match        https://www.summer-plus.net/*
// @match        https://www.snow-plus.net/*
// @match        https://www.south-plus.org/*
// @match        https://south-plus.net/*
// @match        https://south-plus.org/*
// @icon         https://www.south-plus.net/favicon.ico
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    const url = new URL(window.location.href);
    if (url.pathname == '/simple/index.php') {
        const paramPattern = /^t([0-9]+)(?:_([0-9]+))?\.html$/;
        const param = url.searchParams.keys().next().value;

        const matchResult = param.match(paramPattern);
        const threadId = matchResult[1];
        const page = matchResult[2];

        if (threadId != null) {
            if (page != null && page >= 1) {
                window.location.replace(`https://www.south-plus.org/read.php?tid-${threadId}-fpage-0-toread--page-${page}.html`);
            } else {
                window.location.replace(`https://www.south-plus.net/read.php?tid-${threadId}.html`);
            }
        }
    } else if (url.host != 'www.south-plus.net') {
        url.host = 'www.south-plus.net';
        window.location.replace(url);
    }
})();