Greasy Fork镜像 支持简体中文。

去他妈的大会员彩色弹幕

将大会员彩色弹幕改回默认颜色或彻底屏蔽

目前為 2024-09-30 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name 去他妈的大会员彩色弹幕
  3. // @description 将大会员彩色弹幕改回默认颜色或彻底屏蔽
  4. // @author qianxu
  5. // @version 3.1.1
  6. // @match https://*.bilibili.com/video/*
  7. // @match https://*.bilibili.com/list/*
  8. // @match https://*.bilibili.com/bangumi/play/*
  9. // @icon https://www.bilibili.com/favicon.ico
  10. // @namespace https://gf.qytechs.cn/scripts/467808
  11. // @license MIT
  12. // @grant GM_getValue
  13. // @grant GM_setValue
  14. // @grant GM_deleteValue
  15. // @grant GM_registerMenuCommand
  16. // ==/UserScript==
  17.  
  18. // 读取配置
  19. const blockVipDm = GM_getValue('blockVipDm') // 是否彻底屏蔽大会员彩色弹幕
  20. const playerProfile = localStorage.getItem('bpx_player_profile') // 播放器配置
  21.  
  22. // 注册(不可用)菜单
  23. GM_registerMenuCommand(`${blockVipDm ? '✔️' : '❌'} 彻底屏蔽大会员彩色弹幕`, () => {
  24. if (blockVipDm) {
  25. GM_deleteValue('blockVipDm')
  26. } else {
  27. GM_setValue('blockVipDm', true)
  28. }
  29. location.reload()
  30. })
  31.  
  32. // 尝试读取用户设置的描边类型,无则默认为重墨
  33. const strokeType = JSON.parse(playerProfile)?.dmSetting?.fontborder || 0
  34.  
  35. // 根据描边类型设置文本阴影
  36. const textShadow = (() => {
  37. if (strokeType === 1) return '0 0 1px #000,0 0 1px #000,0 0 1px #000' // 描边
  38. if (strokeType === 2) return '1px 1px 2px #000,0 0 1px #000' // 45° 投影
  39. return '1px 0 1px #000,0 1px 1px #000,0 -1px 1px #000,-1px 0 1px #000' // 重墨
  40. })()
  41.  
  42. // 插入样式
  43. const styleElement = document.createElement('style')
  44. if (blockVipDm) {
  45. styleElement.innerHTML = '.bili-dm-vip,.bili-danmaku-x-dm-vip{display:none}'
  46. } else {
  47. styleElement.innerHTML = `.bili-dm,.bili-danmaku-x-dm{--textShadow:${textShadow}}.bili-dm-vip,.bili-danmaku-x-dm-vip{background-image:none !important;text-shadow:inherit !important}`
  48. }
  49. document.body.appendChild(styleElement)

QingJ © 2025

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