您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
默认关闭弹幕!!! 支持bilibi
// ==UserScript== // @name close_danmaku 默认关闭弹幕 // @namespace https://github.com/yekingyan/close_danmaku/ // @version 0.1 // @description 默认关闭弹幕!!! 支持bilibi // @author Yekingyan // @match https://www.bilibili.com/* // @run-at document-start // @grant none // ==/UserScript== (function() { 'use strict'; let host = window.location.host let TARGET_AND_MARK = new Map ([ // [[hostName, switchSelector], [markSelector, markText]], [['bilibili', '.bilibili-player-video-danmaku-switch .bui-checkbox'], ['.bilibili-player-video-danmaku-switch .choose_danmaku', '关闭']], ]) let closeDanmaku = () => { for (let [[hostName, switchSelector], [markSelector, markText]] of TARGET_AND_MARK) { if (host.includes(hostName)) { let [switchDom, markDom] = [switchSelector, markSelector].map(x => document.querySelector(x)) if (!markDom) { switchDom.click() } else if (markDom.innerText.includes(markText)) { switchDom.click() } break } } } window.onload = () => { setTimeout(() => { closeDanmaku() }, 2000); } })();