Greasy Fork is available in English.
净化 B站/哔哩哔哩 页面,支持「精简功能、播放器净化、过滤视频、过滤评论、全站黑白名单」,提供 300+ 功能,定制自己的 B 站
< Commentaires sur bilibili 页面净化大师
或者用 ublock origin 添加
live.bilibili.com##.web-player-module-area-mask:style(backdrop-filter: none !important;)
感谢支持
已注意到直播间打码这一现象,Bilibili-Evolved 有过 讨论
实际上,B站直播使用 getComputedStyle
检测这一元素和它的父元素的计算样式,目前在检测 display
和 visibility
,混淆后代码如下
目前无法保证以后B站是否会更新这一函数加入 backdrop-filter
检测,或增加在线 report 对用户账号造成负面影响
所以我暂时不把隐藏马赛克加入到脚本内,有这个需求的用户就让他自己新增 stylus 脚本或 ublock 规则解决吧
function Tn(e, n, i, r) {
const o = function(e, t) {
var n, i;
const r = null == t ? void 0 : t.area_masks;
if (null == r)
return null;
let o = null;
o = e ? null === (n = r.vertical_masks) || void 0 === n ? void 0 : n[0] : null === (i = r.horizontal_masks) || void 0 === i ? void 0 : i[0];
return null == o ? null : (o.x = Number(o.x),
o.y = Number(o.y),
o.width = Number(o.width),
o.height = Number(o.height),
o.x >= 0 && o.y >= 0 && o.width > 0 && o.height > 0 ? o : null)
}(n, i);
if (null == o)
return {
maskContainerEl: null,
clearAreaMask: ()=>{}
};
const {maskContainerEl: a, maskEl: s, removeMaskEl: l} = function(e, t) {
const n = document.createElement("div");
n.id = "web-player-module-area-mask-panel",
n.style.cssText = "\n position: absolute;\n z-index: 2;\n left: 0px;\n top: 0px;\n pointer-events: none;\n overflow: hidden;\n // background-color: rgba(0, 0, 208, 0.5);\n ",
e.container.appendChild(n);
const i = document.createElement("div");
i.className = "web-player-module-area-mask",
i.style.cssText = `\n position: absolute;\n left: ${100 * t.x}%;\n top: ${100 * t.y}%;\n min-width: 1px;\n min-height: 1px;\n width: ${100 * t.width}%;\n height: ${100 * t.height}%;\n // background-color: rgba(208, 0, 0, 0.5);\n -webkit-backdrop-filter: blur(10px);\n backdrop-filter: blur(10px);\n `,
n.appendChild(i);
const r = document.createElement("div");
"-webkit-backdrop-filter"in r.style || "backdrop-filter"in r.style || (i.style.backgroundColor = "rgba(208, 208, 208, 0.99)",
i.style.filter = "blur(3px)");
function o() {
i.remove(),
n.remove()
}
return {
maskContainerEl: n,
maskEl: i,
removeMaskEl: o
}
}(e, o)
, c = function(e, n, i) {
Pn(e, n);
const r = e.on(t.Bs.FirstFrame, (()=>{
Pn(e, n)
}
));
let o = 0;
function a() {
clearTimeout(o),
o = window.setTimeout((()=>{
Pn(e, n)
}
), i ? 350 : 50)
}
window.addEventListener("resize", a);
const s = un.onChange((()=>{
clearTimeout(o),
o = window.setTimeout((()=>{
Pn(e, n)
}
), 300)
}
))
, l = e.ctrl.onChange(((t,i)=>{
"webFullScreenStatus" === t && (clearTimeout(o),
o = window.setTimeout((()=>{
Pn(e, n)
}
), 50))
}
));
return ()=>{
r(),
clearTimeout(o),
window.removeEventListener("resize", a),
s(),
l()
}
}(e, a, r)
, u = function(e, t, n) {
if (null == e || null == t || null == n)
return ()=>{}
;
let i = ()=>{}
;
const r = setTimeout((()=>{
if ("none" === getComputedStyle(t).display || "none" === getComputedStyle(n).display || "hidden" === getComputedStyle(n).visibility) {
const t = me.default.ErrorCode.AreaMaskBlocked
, n = "涉嫌违规操作,请重试";
me.default.error(t, null != n ? n : ""),
i = (0,
Se.J)(e.container, t, n),
e.destroy()
}
}
), 500);
return ()=>{
i(),
clearTimeout(r)
}
}(e, a, s);
return {
maskContainerEl: a,
clearAreaMask: function() {
c(),
l(),
u()
}
}
}
直播去码,不能用 display: none 会被检查到,放到 liveGroupList