您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
虎牙纯净版(douyu.com)。只保留直播和弹幕【虎牙精简版、虎牙极简版、虎牙清爽版】;支持按钮切换关闭脚本;支持自动切换最高画质;
当前为
// ==UserScript== // @name 纯净版虎牙(pure huya) // @namespace https://github.com/ljezio // @version 1.0.0 // @author ljezio // @description 虎牙纯净版(douyu.com)。只保留直播和弹幕【虎牙精简版、虎牙极简版、虎牙清爽版】;支持按钮切换关闭脚本;支持自动切换最高画质; // @license MIT // @icon https://www.huya.com/favicon.ico // @homepage https://github.com/ljezio/pure-live // @match *://*.huya.com/* // @require https://registry.npmmirror.com/vue/3.5.22/files/dist/vue.global.prod.js // @grant GM_addStyle // ==/UserScript== (function (vue) { 'use strict'; const d=new Set;const importCSS = async e=>{d.has(e)||(d.add(e),(t=>{typeof GM_addStyle=="function"?GM_addStyle(t):document.head.appendChild(document.createElement("style")).append(t);})(e));}; importCSS(" .container[data-v-ec92e721]{z-index:99999;position:fixed;top:0;right:0;background-color:transparent}.button[data-v-ec92e721]{display:block;cursor:pointer;border:none;background-color:transparent;opacity:.3;transition:opacity .3s ease}.button[data-v-ec92e721]:hover{opacity:1} "); const restyleCss = "#duya-header,#matchComponent2,#room-footer,#match-cms-content,#J_roomHeader,#player-gift-wrap,#player-ext-wrap,#player-fullpage-right-btn,#player-fullpage-btn,#J_spbg,.mod-sidebar,.match-top,.match-nav,.room-core-r,.common-popup,.popup-slide-in,.gift-info-wrap{display:none!important}body{background:#000!important}#J_mainRoom{background-image:none!important}#J_mainWrap,#J_mainRoom{padding:0!important}.room-core-l{margin:0!important}#root{height:auto!important}#player-wrap,#player-video{height:100vh!important}#videoContainer{height:calc(100vh + 60px)!important}"; class SwitchFunction { #key; constructor(key) { this.#key = key; } isOn() { return !localStorage.getItem(this.#key); } switch() { if (this.isOn()) { localStorage.setItem(this.#key, "off"); } else { localStorage.removeItem(this.#key); } } } const scriptSwitch = new SwitchFunction("pure_live_switch_script"); const autoHighestImageSwitch = new SwitchFunction( "pure_live_auto_highest" ); const _export_sfc = (sfc, props) => { const target = sfc.__vccOpts || sfc; for (const [key, val] of props) { target[key] = val; } return target; }; const _hoisted_1 = { key: 0, class: "container" }; const _hoisted_2 = ["title"]; const _hoisted_3 = { viewBox: "0 0 1024 1024", xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20" }; const _hoisted_4 = ["fill"]; const _hoisted_5 = { key: 0 }; const _hoisted_6 = ["title"]; const _hoisted_7 = { viewBox: "0 0 1024 1024", xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20" }; const _hoisted_8 = ["fill"]; const onColor = "#2C9EFF"; const offColor = "#D94A3C"; const _sfc_main = { __name: "ButtonGroup", setup(__props) { const showButtonGroup = vue.ref(true); const scriptSwitchOn = vue.ref(scriptSwitch.isOn()); const autoHighestImageSwitchOn = vue.ref(autoHighestImageSwitch.isOn()); vue.onMounted(() => { document.addEventListener("fullscreenchange", () => { showButtonGroup.value = !document.fullscreenElement; }); }); function switchScript() { scriptSwitchOn.value = !scriptSwitchOn.value; scriptSwitch.switch(); location.reload(); } function switchAutoHighestImage() { autoHighestImageSwitchOn.value = !autoHighestImageSwitchOn.value; autoHighestImageSwitch.switch(); } return (_ctx, _cache) => { return showButtonGroup.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [ vue.createElementVNode("button", { class: "button", onClick: switchScript, title: scriptSwitchOn.value ? "关闭脚本" : "启用脚本" }, [ (vue.openBlock(), vue.createElementBlock("svg", _hoisted_3, [ vue.createElementVNode("path", { d: "M512.64 0C229.674667 0 0.298667 229.248 0.298667 512s229.376 512 512.384 512c282.965333 0 512.341333-229.248 512.341333-512S795.605333 0 512.64 0z m-37.290667 225.578667a38.528 38.528 0 0 1 77.141334 0v134.741333a38.528 38.528 0 0 1-77.141334 0V225.578667z m38.570667 578.773333a280.405333 280.405333 0 0 1-280.490667-280.277333 280.192 280.192 0 0 1 203.477334-269.312V323.413333a215.04 215.04 0 0 0 76.970666 415.829334 215.210667 215.210667 0 0 0 215.296-215.125334 215.04 215.04 0 0 0-138.282666-200.704V254.72c117.418667 33.493333 203.477333 141.269333 203.477333 269.312a280.362667 280.362667 0 0 1-280.448 280.32z", fill: scriptSwitchOn.value ? onColor : offColor }, null, 8, _hoisted_4) ])) ], 8, _hoisted_2), scriptSwitchOn.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5, [ vue.createElementVNode("button", { class: "button", onClick: switchAutoHighestImage, title: autoHighestImageSwitchOn.value ? "关闭自动切换最高画质" : "开启自动切换最高画质" }, [ (vue.openBlock(), vue.createElementBlock("svg", _hoisted_7, [ vue.createElementVNode("path", { d: "M0 0m256 0l512 0q256 0 256 256l0 512q0 256-256 256l-512 0q-256 0-256-256l0-512q0-256 256-256Z", fill: autoHighestImageSwitchOn.value ? onColor : offColor }, null, 8, _hoisted_8), _cache[0] || (_cache[0] = vue.createElementVNode("path", { d: "M752.4864 802.048a70.144 70.144 0 0 1-3.4816 0.1024H274.9952A70.144 70.144 0 0 1 204.8 731.9552V326.1952A70.2464 70.2464 0 0 1 274.944 256h474.112a68.9664 68.9664 0 0 1 33.0752 8.2432 70.9632 70.9632 0 0 1 27.136 25.856 73.3696 73.3696 0 0 1 7.8336 18.9952 75.1616 75.1616 0 0 1 2.0992 17.1008v405.76a70.3488 70.3488 0 0 1-43.3152 64.8704 74.24 74.24 0 0 1-16.5376 4.5568 69.2736 69.2736 0 0 1-6.8608 0.6656zM342.9888 392.5504a34.4576 34.4576 0 0 0-28.0576 12.4416 34.2016 34.2016 0 0 0-7.7312 21.6576v204.8a34.048 34.048 0 0 0 4.864 17.5616l0.8704 1.4336a34.9184 34.9184 0 0 0 15.36 12.5952 34.4576 34.4576 0 0 0 29.1328-1.4336 38.0928 38.0928 0 0 0 8.0384-5.9904 32.768 32.768 0 0 0 7.9872-12.6464 33.28 33.28 0 0 0 2.048-11.52V563.2h68.2496v68.2496a34.4576 34.4576 0 0 0 12.4416 26.4192 35.2256 35.2256 0 0 0 16.6912 7.3728 36.3008 36.3008 0 0 0 11.6224-0.3072 30.1056 30.1056 0 0 0 7.936-2.6112 39.2704 39.2704 0 0 0 7.0656-4.4544 33.9968 33.9968 0 0 0 12.4928-26.4192v-204.8a33.792 33.792 0 0 0-13.824-27.392 34.0992 34.0992 0 0 0-54.4256 27.392v68.3008H375.4496V426.6496a34.4576 34.4576 0 0 0-12.4416-26.368 34.2528 34.2528 0 0 0-19.968-7.68z m271.4112 0h-41.5232a26.6752 26.6752 0 0 0-26.7264 26.7264V640.2048a22.528 22.528 0 0 0 0.768 5.12 32.768 32.768 0 0 0 2.3552 6.144 28.16 28.16 0 0 0 6.656 8.0896 26.624 26.624 0 0 0 16.896 6.0416H614.4a139.008 139.008 0 0 0 45.9776-7.9872 135.68 135.68 0 0 0 63.6928-47.2064 144.5376 144.5376 0 0 0 13.7728-22.9888 135.9872 135.9872 0 0 0 7.168-97.9968 132.8128 132.8128 0 0 0-17.1008-36.1984 139.008 139.008 0 0 0-32.2048-33.792 133.632 133.632 0 0 0-35.328-18.944A138.24 138.24 0 0 0 614.4 392.6016z m3.3792 204.6976a66.6112 66.6112 0 0 1-3.3792 0.1024V460.8a67.84 67.84 0 0 1 50.6368 22.4256 69.12 69.12 0 0 1 17.3568 39.168 60.7744 60.7744 0 0 1 0 13.3632 66.304 66.304 0 0 1-7.7312 25.4976 67.8912 67.8912 0 0 1-46.9504 34.816 65.4336 65.4336 0 0 1-9.9328 1.1776z", fill: "#FFFFFF" }, null, -1)) ])) ], 8, _hoisted_6) ])) : vue.createCommentVNode("", true) ])) : vue.createCommentVNode("", true); }; } }; const ButtonGroup = _export_sfc(_sfc_main, [["__scopeId", "data-v-ec92e721"]]); function mountFunctionButton() { vue.createApp(ButtonGroup).mount( (() => { const div = document.createElement("div"); document.body.append(div); return div; })() ); } function autoHighestImage() { if (!autoHighestImageSwitch.isOn()) return; const highestImageInterval = setInterval(() => { const videoType = document.querySelector("#player-ctrl-wrap .player-videotype-list"); if (!videoType) return; for (let li of videoType.children) { if (li.children.length >= 2) { continue; } if (li.className === "on") { break; } li.click(); break; } clearInterval(highestImageInterval); }, 1e3); } function dbClick() { document.body.ondblclick = (event) => { event.stopPropagation(); if (!document.fullscreenElement) { document.querySelector("#player-fullscreen-btn")?.click(); } else { document.exitFullscreen().then(); } }; document.onfullscreenchange = () => { if (!document.fullscreenElement) { setTimeout(() => document.querySelector("#player-fullpage-btn")?.click(), 0); } }; } (() => { if (!document.querySelector("#J_playerMain")) return; mountFunctionButton(); if (scriptSwitch.isOn()) { importCSS(restyleCss); autoHighestImage(); dbClick(); } })(); })(Vue);