☰

Un comentario en A question about b站直播表情下载 de (Usuario eliminado 1522427) ha sido denunciado 5/10/2025 como Spam

(Usuario eliminado 1522427) dijo:

因为新版页面DOM结构中已经移除了` .follow-ctnr `元素,导致`document.getElementsByClassName("follow-ctnr")[0]`返回`undefined`,导致按钮无法插入。
所以只需改写`makeButton()`,让按钮独立固定在页面上,下面代码请自行替换(结合ChatGPT)

```
function makeButton() {
// 检查是否已存在,防止重复创建
if (document.getElementById("bili-emote-download-btn")) return;

const btn = document.createElement("button");
btn.id = "bili-emote-download-btn";
btn.textContent = "下载表情包";
btn.onclick = downloadEmoticons;

// 按钮样式
Object.assign(btn.style, {
position: "fixed",
bottom: "20px",
right: "20px",
zIndex: "99999",
backgroundColor: "#00A1D6",
color: "white",
border: "none",
borderRadius: "8px",
padding: "10px 16px",
fontSize: "14px",
cursor: "pointer",
boxShadow: "0 2px 6px rgba(0,0,0,0.3)",
});

// hover 效果
btn.addEventListener("mouseenter", () => (btn.style.backgroundColor = "#00B5E5"));
btn.addEventListener("mouseleave", () => (btn.style.backgroundColor = "#00A1D6"));

document.body.appendChild(btn);
}

// 监听页面加载(避免SPA延迟)
(function () {
"use strict";
const observer = new MutationObserver(() => {
if (document.body) {
makeButton();
observer.disconnect();
}
});
observer.observe(document.documentElement, { childList: true, subtree: true });
})();
```

Se ha confirmado tu denuncia y ha sido eliminado.

Blatant comment spam