Greasy Fork

Greasy Fork is available in English.

Bangumi排行榜隐藏已收藏条目

排行榜隐藏已收藏条目

目前为 2024-08-26 提交的版本,查看 最新版本

// ==UserScript==
// @name         Bangumi排行榜隐藏已收藏条目
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  排行榜隐藏已收藏条目
// @author       KunimiSaya
// @match        https://bgm.tv/*/browser*
// @match        https://bangumi.tv/*/browser*
// @match        https://chii.in/*/browser*
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
    'use strict';

    // Function to hide collected items
    function hideCollectedItems() {
        // Select all items
        let items = document.querySelectorAll('.item');

        items.forEach(function(item) {
            // Check if the item is collected by looking for the "collectModify" element
            if (item.querySelector('.collectModify')) {
                // Hide the item
                item.style.display = 'none';
            }
        });
    }

    // Run the function after the page has fully loaded
    window.addEventListener('load', hideCollectedItems);
})();