更新了变色弹幕,禁用特殊弹幕样式无效 #4227
Nyte-BK201
started this conversation in
功能建议 / Ideas
Replies: 4 comments 5 replies
-
我看了一眼DOM然后简单ban了一下 .bili-dm-vip { background: none !important; } 能用但是我看style还改了其他的东西 可能有一些样式的小问题 原DOM是这样的(我开了 dark reader 所以会有一些奇怪的注入,忽略就好) <div class="bpx-player-primary-area">
<div class="bpx-player-video-area">
<div class="bpx-player-row-dm-wrap bili-paused">
<div aria-live="polite" role="comment" class="bili-dm bili-center bili-show" style="--opacity: 0.3; --fontSize: 25px; --fontFamily: 'Noto Sans CJK SC DemiLight', Arial, Helvetica, sans-serif; --fontWeight: normal; --color: #ffffff; --offset: 0px; --translateX: -1186px; --duration: 2.2835249999999974s; --top: 40px; --darkreader-text--color: #f0ebe2; --darkreader-border--color: #323535;">
<div style="background: url("http://i0.hdslb.com/bfs/dm/b4f545290caf5a90bd9a96c8d4edefd09bca79bc.png") text; text-shadow: none; -webkit-text-stroke: 4px transparent; --darkreader-inline-bgcolor: initial;" class="bili-dm-vip" data-darkreader-inline-bgcolor="">
主摄没有OIS防抖,荣耀老传统了
</div>
</div>
</div>
</div>
</div> |
Beta Was this translation helpful? Give feedback.
3 replies
-
在 chatgpt 的指导下简单糊了一个油猴脚本,勉强能用( // ==UserScript==
// @name B站移除大会员弹幕颜色
// @namespace galaxysnail
// @version 1.2
// @description none
// @author GalaxySnail
// @match https://www.bilibili.com/video/*
// @icon https://www.bilibili.com/favicon.ico
// @grant none
// ==/UserScript==
(function() {
'use strict';
const observer = new MutationObserver((mutation_records, observer) => {
let record = null
const handler = (elem) => {
if (!(elem instanceof HTMLElement)) return
if (!(elem.matches(".bili-dm-vip"))) return
// console.log(record.type, record.attributeName, elem)
elem.removeAttribute("style")
elem.classList.add('bili-dm')
}
for (record of mutation_records) {
switch(record.type) {
case "childList":
record.addedNodes.forEach(handler)
break
case "attributes":
handler(record.target)
break
}
}
})
const target = document.querySelector("#bilibili-player > div > div > div.bpx-player-primary-area")
observer.observe(target, {
childList: true,
subtree: true,
attributes: true,
attributeFilter: ["style"],
})
})(); |
Beta Was this translation helpful? Give feedback.
0 replies
-
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
希望跟进一下,去掉炫彩弹幕样式
Beta Was this translation helpful? Give feedback.
All reactions