Only the Big Three

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

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 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 });
})();