n0099 Kagura_mea
done. 有油猴的直接用,不发布了
// ==UserScript==
// @name 禁B站表情
// @namespace http://tampermonkey.net/
// @version 0.3
// @description 消灭B豆
// @author V87
// @match https://*.bilibili.com/*
// @icon https://www.iconsdb.com/icons/preview/red/letter-v-xxl.png
// @grant none
// ==/UserScript==
window.addEventListener("load",()=>{
let list = document.getElementsByClassName("left-container-under-player")
if(!list || list.length == 0){
list = document.getElementsByClassName("router-view")
}
if(list != null && list.length > 0){
list = list[0]
new MutationObserver((mutationsList, observer)=>{
if (mutationsList.length > 0 && mutationsList[0].type === 'childList') {
replaceEmoji_bili();
}
}).observe(list,{childList: true, subtree: true})
}
})
function replaceEmoji_bili() {
let a = document.getElementsByClassName("small")
if(!a || a.length == 0){
a = document.getElementsByClassName("img-emoji")
try{a.forEach(e => { e.style.backgroundImage="" })}catch{}
}
else{
try{a.forEach(e => { e.src="" })}catch{}
}
}
// left-container-under-player 评论区所在div
// router-view 私信im界面所在div
edit:更新于2022/5/31