您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
2024/1/22 20:30:44
// ==UserScript== // @name 【B站】稍后再看——筛选已观看视频 // @match https://www.bilibili.com/watchlater/* // @grant none // @version 1.0 // @license MIT // @namespace LianTianYou // @author LianTianYou // @description 2024/1/22 20:30:44 // ==/UserScript== (() => { /** * 筛选或还原已看视频 */ function filterLooked() { const videoList = document.querySelectorAll(".list-box .av-item"); videoList.forEach((item) => { if (!item.querySelector(".looked")) { if (item.style.display !== "none") { item.style.display = "none"; } else { item.style.display = "block"; } } }); } /** * 入口函数 */ function main() { let isFilter = false; const filterBtn = document.createElement("a"); filterBtn.className = "s-btn"; filterBtn.textContent = "筛选已观看"; filterBtn.addEventListener("click", () => { isFilter = !isFilter; filterBtn.textContent = isFilter ? "还原未观看" : "筛选已观看"; filterLooked(); }); document.querySelector(".r-con").append(filterBtn); } main(); })();