B站简化

简化B站,去除页面无用元素

安装此脚本?
作者推荐脚本

您可能也喜欢bilibili 页面净化大师

安装此脚本
  1. // ==UserScript==
  2. // @name B站简化
  3. // @namespace https://huanfei.top/
  4. // @version 1.2.3
  5. // @description 简化B站,去除页面无用元素
  6. // @author huanfei
  7. // @match *://*.bilibili.com/*
  8. // @icon https://www.bilibili.com/favicon.ico
  9. // @grant GM_addStyle
  10. // @grant GM_registerMenuCommand
  11. // @grant GM_setValue
  12. // @grant GM_getValue
  13. // @license MIT License
  14. // @run-at document-start
  15. // ==/UserScript==
  16.  
  17. (function () {
  18. 'use strict';
  19. // 自定义样式去除
  20. const style = [
  21. '.bili-avatar-pendent-dom', // 头像挂件
  22. '.user .medal', // 荣誉
  23. '.fan-badge', // 粉丝勋章
  24. '.sailing',
  25. '.bb-comment .nameplate, .comment-bilibili-fold .nameplate, .nameplate-holder', // 成就徽章
  26. '.reply-notice', // 评论通知
  27. '.left-loc-entry', // 顶部栏杂项
  28. 'ul.right-entry > .vip-wrap, .item:has(#van-popover-6213)', // 顶部栏大会员按钮
  29. '.vip-entry-containter', // 充值大会员
  30. '.up-info-container .bili-avatar{width:48px !important;height:48px !important;transform:translate(0px, 0px) !important}', // 头像样式修复
  31. // 首页
  32. '.recommended-swipe.grid-anchor',
  33. '.feed-card:has(.bili-video-card__info--ad)',
  34. '.container.is-version8 > .floor-single-card',
  35. '.bili-video-card.is-rcmd:has(.bili-video-card__info--ad)',
  36. '.feed-roll-btn',
  37. '.bili-live-card.is-rcmd',
  38. '.bili-video-card.is-rcmd:empty', // 与广告屏蔽插件同时启用时出现的空白格
  39. '.feed-card:has(.bili-video-card.is-rcmd:empty)', // 与广告屏蔽插件同时启用时出现的空白格
  40. '.feed-card{margin-top:40px !important;display:block !important}',
  41. '.bili-video-card:has(.loading_animation), .load-more-anchor{margin-top:40px !important;}',
  42. '.load-more-anchor .floor-skeleton{border:none !important;box-shadow:none !important;}',
  43. '.load-more-anchor .layer',
  44. '.bili-video-card .bili-video-card__skeleton--light',
  45. // 播放页
  46. '#bannerAd',
  47. '.reply-decorate',
  48. 'a#right-bottom-banner',
  49. '#slide_ad',
  50. 'a.ad-report.video-card-ad-small',
  51. '.video-page-special-card-small',
  52. 'span.add-follow-btn',
  53. 'div#activity_vote',
  54. 'span.argue.item', // 安全提醒
  55. '.pop-live-small-mode', // 大家围观的直播
  56. '.bpx-player-cmd-dm-wrap', // 弹幕弹窗
  57. '.bili-cmd-shrink', // 弹幕弹窗
  58. '.toolbar-right-ai', // AI 总结
  59. '.reply-item:has(i.top-icon ~ a.jump-link.normal)', // 置顶的广告评论
  60. 'span.copyright.item', // 版权栏
  61. '.video-sections-content-list{max-height:400px !important;height:auto !important;}', // 播放列表加长
  62. // 动态页
  63. '.bili-dyn-item__interaction', // 热门评论
  64. '.bili-dyn-item__ornament', // 右上角标志
  65. '.bili-dyn-list__item:has(.bili-rich-text-module.lottery)', // 抽奖动态
  66. '.bili-dyn-list__item:has(.bili-dyn-card-goods)', //抽奖带货
  67. 'aside.right .sticky', // 右侧推荐
  68. '.bili-dyn-content__dispute', // 安全提醒
  69. '.b-avatar__canvas > div.b-avatar__layers:not(:nth-child(1))', // 头像挂件
  70. '.b-avatar__layers > div:not(:nth-child(1))', // 头像挂件
  71. '.reply-tag-list', // 热评标签
  72. '.container.is-version8>.bili-video-card.is-rcmd{margin-top:40px !important}',
  73. '.b-avatar__layer.center{width:48px !important;height:48px !important}', // 认证标志
  74. '.bili-dyn-live-users{position:inherit !important;top:0px !important}', //动态左侧直播不随屏幕滚动
  75. // 搜索页
  76. '.video-list > div:has(.bili-video-card__info--ad)',
  77. '#biliMainFooter',
  78. GM_getValue('history_show', true) ? '' : '.search-panel .history, .search-pannel .history', // 搜索历史
  79. // 直播
  80. // 直播-右侧弹幕栏
  81. 'div#chat-items > div:not(.chat-item.danmaku-item)', // 弹幕位置的所有非用户弹幕元素
  82. '.danmaku-item-left > *:not(.common-nickname-wrapper)', // 弹幕用户名称左侧的杂类元素
  83. '#chat-items .danmaku-item-right.emoticon.bulge span.open-menu{display:block !important}', // 图片表情
  84. '#chat-items .danmaku-item-right.emoticon.bulge img.open-menu', // 图片表情
  85. '#aside-area-vm > *:not(.chat-history-panel, #chat-control-panel-vm)', // 非弹幕元素
  86. '#aside-area-vm > .chat-history-panel > *:not(.chat-history-list, .danmaku-menu)', // 非弹幕元素
  87. '#aside-area-vm .chat-history-list{height: 100% !important;padding:5px !important;}', // 非弹幕元素
  88. '#control-panel-ctnr-box > *:not(.control-panel-icon-row, .chat-input-ctnr, .bottom-actions, .dialog-ctnr)', // 非弹幕元素
  89. '#chat-items .chat-item.danmaku-item{background-color: transparent !important;border-image-source: none !important;}', // 弹幕颜色统一
  90. '.chat-item.danmaku-item > div:not(.danmaku-item-left, .danmaku-item-right)',
  91. '.chat-history-panel .chat-history-list .chat-item.superChat-card-detail', // SC
  92. '#control-panel-ctnr-box .icon-right-part > div:is(.super-chat, .like-btn)', // SC 跟点赞按钮
  93. '.chat-input-ctnr .medal-section', // 佩戴粉丝勋章
  94. // 直播-其他栏
  95. '.blive-avatar-pendant', // 头像边框
  96. '#sections-vm, #link-footer-vm', // 底栏
  97. '.blive-avatar-icons', // 头像右下角认证
  98. '#head-info-vm .lower-row .right-ctnr{visibility: hidden !important;}', // 人气排行榜
  99. 'span.user-name{color:var(--text3) !important;}', // 用户名颜色统一
  100. '.chat-history-panel{height:calc(100% - 145px) !important;background-color: var(--bg1) !important;}', // 弹幕背景颜色统一
  101. 'div#aside-area-vm{overflow: hidden !important;}', // 圆角统一
  102. '.announcement-wrapper', // 窗口弹幕横幅
  103. '#gift-control-vm > .gift-control-panel',
  104. '#gift-control-vm{height:45px !important;}',
  105. '#chat-items > .chat-item.danmaku-item{margin: 0px !important;}',
  106. ];
  107.  
  108. GM_addStyle(style.map(e => (/.*{.*}$/.test(e) ? e : `${e}{display:none !important;}`)).join(''));
  109.  
  110. // 去除复制小尾巴
  111. window.addEventListener('copy', e => e.stopPropagation(), true);
  112.  
  113. // 视频页停留25秒自动点赞视频
  114. if (GM_getValue('auto_like', false) && /\/video\//.test(location.pathname)) {
  115. setInterval(() => {
  116. document.querySelector('.video-like.video-toolbar-left-item:not(.on)').click();
  117. console.log('已点赞视频');
  118. }, 25000);
  119. }
  120.  
  121. // 自定义菜单
  122. GM_registerMenuCommand((GM_getValue('auto_like', false) ? '✅' : '❌') + '自动点赞', () => {
  123. GM_setValue('auto_like', !GM_getValue('auto_like', false));
  124. location.reload();
  125. });
  126. GM_registerMenuCommand((GM_getValue('history_show', true) ? '✅' : '❌') + '搜索历史显示', () => {
  127. GM_setValue('history_show', !GM_getValue('history_show', true));
  128. location.reload();
  129. });
  130. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址