Greasy Fork

Greasy Fork is available in English.

Crunchyroll Watchlist Hider

Hides watched animes so it is easier to spot new episodes

当前为 2025-04-05 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Crunchyroll Watchlist Hider
// @version      2.2
// @description  Hides watched animes so it is easier to spot new episodes
// @match        https://www.crunchyroll.com/*
// @icon         https://www.google.com/s2/favicons?domain=crunchyroll.com
// @grant        none
// @namespace    http://greasyfork.icu/users/206408
// ==/UserScript==

(function() {
    'use strict';

    // Your code here...
    function l(...args){
        console.log('[Watchlist]', ...args)
    }

    function filter(){
        let cards = document.querySelectorAll(".watchlist-card--YfKgo")
        l(cards)
        for(let card of cards){
            let text = card.querySelector(".watchlist-card-subtitle--IROsU").textContent
            if(text.includes("Watch Again")){
                card.style.filter = 'brightness(0.15)'
            }
          }
      }


    //Observe changes to the DOM
    const observer = new MutationObserver((mutationsList, observer) => {
        if(window.location.href === 'https://www.crunchyroll.com/watchlist'){
            l(mutationsList)

            for (const mutation of mutationsList) {
                if (mutation.addedNodes.length > 0) {
                    l('Nodes added')
                    filter();
                    break; // Stop after the first relevant mutation to avoid redundant filtering
                }
            }
        }
    })

    observer.observe(document, {subtree:true, childList:true, attributes:false})
})();