Greasy Fork

来自缓存

Greasy Fork is available in English.

Bangumi.tv 净化

将 Bangumi.tv 中其他用户的所有活动例如评分、评论等信息隐藏,仅留下制作信息、内容介绍等客观信息。

当前为 2024-04-15 提交的版本,查看 最新版本

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

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

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

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

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

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Bangumi.tv 净化
// @version      1.0
// @description  将 Bangumi.tv 中其他用户的所有活动例如评分、评论等信息隐藏,仅留下制作信息、内容介绍等客观信息。
// @author       takuzzz
// @match        *://bgm.tv/*
// @match        *://bangumi.tv/*
// @grant        none
// @license MIT
// @namespace http://greasyfork.icu/users/65521
// ==/UserScript==

(function() {
    'use strict';

    // Array of text contents to match and remove
    const textContentsToRemove = [
        "讨论版", "评论", "吐槽箱", "推荐本条目的目录", "谁看这部动画?", "收藏盒", "Sumomo Board"
    ];

    // Array of element IDs to remove
    const idsToRemove = [
        "panelInterestWrapper", "subjectPanelIndex", "subjectPanelCollect", "crtPanelCollect", "robot",
        "award2023", "home_tml"
    ];

    const classToRemove = [
        "rateInfo", "rank",
    ];

    // Function to remove elements with specific text content
    function removeElementsByTextContent() {
        // Find all h2 elements with class 'subtitle'
        const subtitles = document.querySelectorAll('h2.subtitle');

        // Loop through the found h2 elements
        subtitles.forEach(function(subtitle) {
            // Check if the text content is in the array
            if (textContentsToRemove.includes(subtitle.textContent.trim())) {
                // Get the parent div of the h2 element
                const parentDiv = subtitle.closest('div');
                // Remove the parent div if it exists
                if (parentDiv) {
                    parentDiv.remove();
                }
            }
        });
    }

    // Function to remove elements by ID
    function removeElementsById() {
        idsToRemove.forEach(function(id) {
            const element = document.getElementById(id);
            if (element) {
                element.remove();
            }
        });
    }

    function removeElementsByClass() {
        classToRemove.forEach(function(className) {
            const elements = document.getElementsByClassName(className);
            while (elements.length > 0) {
                elements[0].parentNode.removeChild(elements[0]);
            }
        });
    }


    removeElementsByTextContent();
    removeElementsById();
    removeElementsByClass();

})();