Switch520 搜索修复

修复在任意页面搜索导致改为全局搜索而不是特定区。如原搜索表单在switch分区搜索会导致改为全局搜索,而非专区搜索!

// ==UserScript==
// @name         Switch520 搜索修复
// @namespace    http://tampermonkey.net/
// @version      2025-07-02
// @description  修复在任意页面搜索导致改为全局搜索而不是特定区。如原搜索表单在switch分区搜索会导致改为全局搜索,而非专区搜索!
// @author       You
// @match        https://www.gamer520.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=gamer520.com
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    // Your code here...
    const split = location.href.split("/")
    const result = [
        split[0],
        split[1],
        split[2],
        split[3]
    ]
    document.querySelectorAll(".search-form")[0].action = result.join("/")
})();