您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Hide watched animes so it is easier to spot new episodes
当前为
- // ==UserScript==
- // @name Crunchyroll Watchlist
- // @version 1
- // @description Hide watched animes so it is easier to spot new episodes
- // @match https://beta.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 container = document.querySelector("#content > div > div.app-body-wrapper > div > div > div.erc-watchlist > div.watchlist-body > div:nth-child(1) > div > div")
- for(let row of container.children){
- row = row.children[0]
- for(let item of row.children){
- let card = item.querySelector('.c-watchlist-card')
- if(card){ //not a loading placeholder
- let subtitle = card.querySelector('.c-watchlist-card__subtitle').textContent
- if(subtitle.includes('Watch Again')){
- //Do something with animes watched
- card.style.filter = 'brightness(0.1)'
- }
- }
- }
- }
- }
- //Observe changes to the DOM since there are no events that can be used
- const observer = new MutationObserver((mutationsList, observer) => {
- if(window.location.href === 'https://beta.crunchyroll.com/watchlist'){
- for(const mutation of mutationsList){
- //Items added to the watchlist grid
- if(['ReactVirtualized__Grid__innerScrollContainer', 'ReactVirtualized__Grid ReactVirtualized__List'].includes(mutation.target.className)){
- filter()
- }
- }
- }
- })
- observer.observe(document, {subtree:true, childList:true, attributes:true})
- })();