Greasy Fork

Greasy Fork is available in English.

AniListStaff过滤

在AniList的staff页面增加一个一键过滤"on my list"的按钮

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         AniListStaff过滤
// @namespace    http://tampermonkey.net/
// @version      2024-04-06
// @description  在AniList的staff页面增加一个一键过滤"on my list"的按钮
// @author       You
// @match        https://anilist.co/staff/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=anilist.co
// @license MIT
// ==/UserScript==

(function() {
    'use strict';

    // 创建按钮
    let btn = document.createElement("input");
    btn.type = "button";
    btn.value = "过滤";
    btn.style.position = "fixed";
    btn.style.bottom = "40px"; // 控制按钮距离页面顶部的距离
    btn.style.right = "40px"; // 控制按钮距离页面左侧的距离
    btn.style.width = "50px";
    btn.style.height = "50px";
    btn.style.zIndex = 1000;

    document.body.appendChild(btn);
    btn.onclick = function() {
        let list = document.querySelectorAll(".role-card");
        for (let index in list) {
            if (list[index].children && list[index].children.length >= 2) {
                console.log(list[index].children[1].children[0]);
                let childWithStatus = list[index].children[1].children[0].children[0];
                if (childWithStatus != null) {
                    list[index].style.display = 'none';
                }
            }
        }
    };
})();