Greasy Fork

Greasy Fork is available in English.

bilibili 弹幕关闭

自动关闭哔哩哔哩 HTML5 播放器弹幕.

当前为 2019-04-05 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name                bilibili Danmaku Disabler
// @name:zh-CN          bilibili 弹幕关闭
// @description         Auto disable bilibili HTML5 player danmaku.
// @description:zh-CN   自动关闭哔哩哔哩 HTML5 播放器弹幕.
// @namespace           bilibili-danmaku-disabler
// @version             2019.04.05
// @author              kazetoyuki
// @license             MIT License
// @match               *://www.bilibili.com/video/*
// @match               *://www.bilibili.com/bangumi/play/*
// @run-at              document-idle
// @require             https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js
// @require             http://greasyfork.icu/scripts/48306-waitforkeyelements/code/waitForKeyElements.js?version=275769
// ==/UserScript==

'use strict';

waitForKeyElements ("input.bui-checkbox:checked", disable_danmaku_new, false);
waitForKeyElements ("div.bilibili-player-video-btn-danmaku[name='ctlbar_danmuku_on']", disable_danmaku_old, false);

/* For New HTML5 Player */
function disable_danmaku_new () {
    document.querySelector ("input.bui-checkbox:checked").click ();
}
/* For Old HTML5 Player */
function disable_danmaku_old () {
    document.querySelector ("i.icon-24danmuon").click ();
}