andywang425 / BLTH

哔哩哔哩(bilibili.com)油猴辅助脚本,Bilibili Live Tasks Helper。
MIT License
994 stars 95 forks source link

✨ feat: 移除直播间马赛克 #494

Closed ADJazzzz closed 5 months ago

ADJazzzz commented 5 months ago

493

不用display: none是因为B站打码的代码中带有检测:

function(e, t, n) {
    if (null == e || null == t || null == n || 0 == n.length)
        return ()=>{}
        ;
    let i = ()=>{}
    ;
    const r = setTimeout((()=>{
        let r = !1;
        "none" === getComputedStyle(t).display && (r = !0);
        for (let e = 0; e < n.length; e++) {
            const t = n[e];
            if (null != t && ("none" === getComputedStyle(t).display || "hidden" === getComputedStyle(t).visibility)) {
                r = !0;
                break
            }
        }
        if (r) {
            const t = U.default.ErrorCode.AreaMaskBlocked
              , n = "涉嫌违规操作,请重试";
            U.default.error(t, null != n ? n : ""),
            i = (0,
            Q.J)(e.container, t, n),
            e.destroy()
        }
    }
    ), 500);
    return ()=>{
        i(),
        clearTimeout(r)
    }
}

但是不检测透明度🤣

andywang425 commented 5 months ago

可以的,这招先用着。

我还有个想法就是把position设置为absolute,然后把元素位置设置到屏幕外边去。