您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
虎牙精简版,移除首页直播,移除直播礼物特效等不必要元素,还你纯粹的直播体验
当前为
// ==UserScript== // @name 虎牙页面优化 // @namespace http://tampermonkey.net/ // @version 1.3 // @description 虎牙精简版,移除首页直播,移除直播礼物特效等不必要元素,还你纯粹的直播体验 // @author You // @match https://www.huya.com/* // @icon https://www.google.com/s2/favicons?sz=64&domain=huya.com // @grant none // @license MIT // @require http://code.jquery.com/jquery-3.5.0.min.js // ==/UserScript== (function () { 'use strict'; $(document).ready(main); })(); function main() { const style = document.createElement('style'); style.innerHTML = ` /* 侧边悬浮菜单栏 */ a[href="//www.huya.com/download/"], a[href="https://hd.huya.com/pc/2019zhubo/pages/index.html"], a[href="https://hd.huya.com/web/about/index.html#contact"], a[href="https://wan.huya.com/"] { display: none !important; } .helperbar--cpOuG7OGer2wWrNst9OwG>* { display: none; } .helperbar--cpOuG7OGer2wWrNst9OwG>.helper-nav--1yz7uIycIDu_3rI5oz1pJr { display: block; } /* 顶部菜单栏 */ .NavKaiBo--3_pcnDZbeaycODmpgNFBtt, .NavDownload--14eln2LYTFMgF_MZOue4Gu, #J_hyNavItemYouliao, #J_hyHdNavItemGame { display: none; } /* 直播特效(ad与特效弹幕) */ #player-marquee-wrap, #huya-ab-fixed, #huya-ab { display: none; } /* 订阅按钮一列 */ #J_roomHdR > div > div { display: none !important; } #J_roomHdR > div > .subscribe-entrance { display: block !important; } ` document.querySelector('body').append(style); /// 首页 (function () { if (location.href !== 'https://www.huya.com/') return; document.querySelector('#duya-header').style.backgroundColor = 'rgb(167 167 167)'; const banner = document.querySelector('#banner'); banner.innerHTML = ''; $(banner).css({ 'position': 'inherit', 'height': '60px', 'background-image': 'url()', 'background-color': '#ffffff' }); // 暂停直播 document.querySelector('#player-btn')?.click(); // 移除直播 document.querySelector('.mod-index-main')?.remove(); })(); // 直播页 (function () { if (location.href === 'https://www.huya.com/') return; // 免登录(不可用) if (VPlayer.prototype.checkLogin) VPlayer.prototype.checkLogin(true); $(document.querySelector('#J_mainWrap')).css({ 'padding-left': '0px', 'display': 'flex', 'justify-content': 'center', 'align-items': 'center' }); document.querySelector('.mod-sidebar')?.remove(); const main = document.querySelector('#main_col'); const videoBox = main.querySelector('#J_mainRoom'); // 净化直播容器 const core = videoBox.querySelector('.room-core'); videoBox.replaceChildren(core); // 移除右侧弹幕 core.replaceChildren(core.querySelector('.room-core-l')); // 净化主容器 main.replaceChildren(videoBox); videoBox.style.margin = 0; // 订阅按钮一列 const a = document.querySelector('.host-control.J_roomHdCtrl'); a.replaceChildren(a.querySelector('.subscribe-entrance')); (() => { // 优化视频布局 $(document.querySelector('#main_col')).css({ 'display': 'flex', 'justify-content': 'center', 'align-items': 'center', }); $(document.querySelector('#J_mainRoom')).css({ 'padding': '0 0 0 0', 'min-width': '0', 'width': 'calc((100vmin - 20px - 60px) * 1.4)', }); $(document.querySelector('.room-core .room-core-l')).css({ 'margin-right': '0' }); })(); })(); }
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址