Only the Big Three

Removes Tears of Themis, Honkai Impact 3rd, Honkai: Nexus Anima, and Petit Planet from HoYoLAB search and home menu.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Only the Big Three
// @namespace    http://tampermonkey.net/
// @version      0.5
// @description  Removes Tears of Themis, Honkai Impact 3rd, Honkai: Nexus Anima, and Petit Planet from HoYoLAB search and home menu.
// @match        https://www.hoyolab.com/*
// @grant        none
// @icon         https://webstatic.hoyoverse.com/upload/op-public/2021/04/12/bbeb16029152ef690abb1d41dd1a8f78_7756606814264622244.png
// ==/UserScript==

(function() {
    'use strict';

    const blockedGames = [
        "Tears of Themis", "TearsofThemis",
        "Honkai Impact 3rd", "HonkaiImpact3rd",
        "Honkai: Nexus Anima", "HonkaiNexusAnima",
        "Petit Planet", "PetitPlanet"
    ];

    function hideBlockedGames() {

        document.querySelectorAll("li.game-item").forEach(item => {
            if (blockedGames.some(game => item.textContent.includes(game))) {
                item.style.display = "none";
            }
        });

        document.querySelectorAll("li.mhy-selectmenu__item").forEach(item => {
            const label = item.querySelector(".mhy-selectmenu__label")?.textContent.trim();
            if (blockedGames.includes(label)) {
                item.style.display = "none";
            }
        });
    }

    let tries = 0;
    const interval = setInterval(() => {
        hideBlockedGames();
        tries++;
        if (tries > 20) clearInterval(interval);
    }, 200);

    const observer = new MutationObserver(hideBlockedGames);
    observer.observe(document.body, { childList: true, subtree: true });
})();