您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
B站快捷键扩展,适合学习类视频.包括自动宽屏 低亮度模式 黑暗模式d 弹幕开关h 2倍速c 减速x 1倍速z
当前为
// ==UserScript== // @name BiliAuto // @version 1.0.5 // @author mishi321 // @description B站快捷键扩展,适合学习类视频.包括自动宽屏 低亮度模式 黑暗模式d 弹幕开关h 2倍速c 减速x 1倍速z // @match https://www.bilibili.com/video/* // @grant GM_getValue // @grant GM_setValue // @grant GM_registerMenuCommand // @grant GM_unregisterMenuCommand // @namespace https://gf.qytechs.cn/users/789988 // ==/UserScript== (function () { if (window.location.href.includes('note=open')) { window.location.href = window.location.href.replace('note=open', 'note='); return; } let speedIndex = 3; let lightOn = false, two2one = true; let filterOn = GM_getValue('filterOn'), widescreenOn = GM_getValue('widescreenOn'); GM_registerMenuCommand("自动宽屏:" + widescreenOn, () => { GM_setValue('widescreenOn', !widescreenOn); window.location.reload(); }); let id1 = GM_registerMenuCommand("低亮度模式:" + filterOn, filter); const video = document.getElementsByTagName('bwp-video')[0]; const observe = new MutationObserver(() => { if (filterOn === true && (two2one = !two2one)) { document.getElementsByClassName('bilibili-player-video')[0].style.cssText = "filter:brightness(0.6834);"; } }) filterOn && (document.getElementsByClassName('bilibili-player-video')[0].style.cssText = "filter:brightness(0.6834);") && observe.observe(video, { attributes: true }); widescreenOn && video.addEventListener('play', () => document.getElementsByClassName('bilibili-player-video-btn-widescreen')[0]?.click(), { once: true }); document.getElementsByClassName('list-box')[0] && video.addEventListener('ended', () => document.getElementsByClassName('bilibili-player-video-btn-next')[0].click()); document.body.addEventListener('keypress', (e) => { if (e.target.nodeName !== 'BODY') { return; } switch (e.key) { case 'c': document.getElementsByClassName('bilibili-player-video-btn-speed-menu-list')[speedIndex = 0].click(); break; case 'x': speedIndex < 5 && ++speedIndex; document.getElementsByClassName('bilibili-player-video-btn-speed-menu-list')[speedIndex].click(); break; case 'z': document.getElementsByClassName('bilibili-player-video-btn-speed-menu-list')[speedIndex = 3].click(); break; case 'd': if (lightOn = !lightOn) { document.body.classList.add('player-mode-blackmask'); document.getElementById('heimu').style.display = 'block'; document.getElementById('bilibiliPlayer').classList.add('mode-light-off'); } else { document.body.classList.remove('player-mode-blackmask'); document.getElementById('heimu').style.display = 'none'; document.getElementById('bilibiliPlayer').classList.remove('mode-light-off'); } break; case 'h': document.getElementsByClassName('bilibili-player-video-danmaku-switch')[0].children[0].click(); break; default: break; } }); function filter() { if (filterOn = !filterOn) { GM_setValue('filterOn', filterOn); document.getElementsByClassName('bilibili-player-video')[0].style.cssText = "filter:brightness(0.6834);"; observe.observe(video, { attributes: true }); } else { GM_setValue('filterOn', filterOn); document.getElementsByClassName('bilibili-player-video')[0].style.cssText = ""; } GM_unregisterMenuCommand(id1); id1 = GM_registerMenuCommand("低亮度模式:" + filterOn, filter); } })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址