Crunchyroll Watchlist Hider

Hides watched animes so it is easier to spot new episodes

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

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

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

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

你需要先安裝一款使用者腳本管理器擴展,比如 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    https://greasyfork.org/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})
})();