您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
自动关闭哔哩哔哩 HTML5 播放器弹幕.
当前为
// ==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.05.03 // @author kazetoyuki // @license MIT License // @run-at document-idle // @require https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js // @require https://greasyfork.org/scripts/48306-waitforkeyelements/code/waitForKeyElements.js?version=275769 // @match *://www.bilibili.com/video/* // @match *://www.bilibili.com/bangumi/play/* // ==/UserScript== 'use strict'; var selector = { "player": "div[class='feedback-btn']", // true -> new player true: { "on": "input[class='bui-checkbox']:checked", "off": "input[class='bui-checkbox']:not(:checked)" }, // false -> old player false: { "on": "div[name='ctlbar_danmuku_on']", "off": "div[name='ctlbar_danmuku_close']" } }; var version = document.querySelector(selector.player) != null; function switch_danmaku(player) { if (document.querySelector(player.on) != null) { // Switch danmaku on -> off document.querySelector(player.on).click(); } else { // Switch danmaku off -> on document.querySelector(player.off).click(); } }; function disable_danmaku(player) { player[0].click (); }; waitForKeyElements(selector[version].on, disable_danmaku, false); $(document).keypress(function(key) { // detect 'm' or 'M' Key if (key.which === 77 || key.which === 109) { switch_danmaku(selector[version]); } });