Bài này hướng dẫn anh em "khóa mõm" của một số tài khoản nhất định dựa theo Profile ID Blogger.
Tự động thay avatar thành biểu tượng cấm, đổi tên thành Blocked User, thay nội dung và làm mờ khung bình luận.
Tự động thay avatar thành biểu tượng cấm, đổi tên thành Blocked User, thay nội dung và làm mờ khung bình luận.
Code
<!-- khóa mõm -->
<script>
document.addEventListener("DOMContentLoaded", function () {
const blockedUsers = [
"07681083261644181883",
"01234567891011121314",
"01234567891011121314"
];
function getProfileIdFromLink(href) {
const m = href && href.match(/\/profile\/(\d+)/);
return m ? m[1] : null;
}
function blockOneComment(block) {
if (!block) return;
const userLink = block.querySelector(".comment-header .user a[href*='blogger.com/profile/']");
if (!userLink) return;
const uid = getProfileIdFromLink(userLink.href);
if (!uid || !blockedUsers.includes(uid)) return;
const comment = block.closest(".comment");
const avatarBox = comment?.querySelector(".avatar-image-container");
if (avatarBox) {
avatarBox.innerHTML = `
<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"
width="45" height="45" fill="#d32f2f" title="Người dùng bị chặn">
<circle cx="256" cy="256" r="200" fill="none" stroke="#d32f2f" stroke-width="40"/>
<line x1="120" y1="392" x2="392" y2="120" stroke="#d32f2f" stroke-width="40"/>
</svg>
`;
}
userLink.textContent = "Blocked User";
userLink.removeAttribute("href");
userLink.removeAttribute("target");
userLink.removeAttribute("rel");
userLink.style.pointerEvents = "none";
const content = block.querySelector(".comment-content");
if (content) {
content.textContent = "Nội dung cho người dùng bị cấm đăng lên vì vậy không hiển thị";
}
block.style.opacity = "0.7";
block.style.pointerEvents = "none";
}
document.querySelectorAll(".comment-block").forEach(blockOneComment);
const holder = document.querySelector("#comment-holder") || document.body;
const mo = new MutationObserver(() => {
document.querySelectorAll(".comment-block").forEach(blockOneComment);
});
mo.observe(holder, { childList: true, subtree: true });
});
</script>
<!-- khóa mõm -->
Lưu ý
Cách lấy Profile ID
- Mở trang bình luận nơi người đó đã comment.
- Nhấp vào tên người dùng (liên kết thường có dạng
https://www.blogger.com/profile/xxxxxxxxxxxxxxxxxxx). - Sao chép dãy số sau
/profile/và thêm vào mảngblockedUserstrong script.
Nếu vẫn thấy bình luận của người bị chặn?
- ID đã đúng (khớp dãy số trong URL profile).
- Template có đúng selector:
.comment-block,.avatar-image-container,.comment-header .user a,.comment-content. Nếu khác, hãy đổi selector tương ứng.
Tùy chọn hiển thị
- Ẩn hoàn toàn bình luận: thay hai dòng cuối trong hàm
blockOneCommentbằng:
block.closest(".comment")?.remove(); - Đổi biểu tượng: thay đoạn SVG trong
avatarBox.innerHTMLbằng SVG khác tùy ý. - Đổi thông điệp: sửa chuỗi “Nội dung cho người dùng bị cấm…” theo ý bạn.
Kết luận
- Nên khóa hết mõm mấy thằng hay spam cho đỡ rác
- Để lại bình luận nếu bạn cần hỗ trợ

