给论坛写了个脚本,屏蔽某些人 失效了,更新下

gaoyuyu 5月前 6048

原地址https://assbbs.com/thread-35004.htm

配合篡改猴(Tampermonkey)或油猴(Greasemonkey)使用

// ==UserScript==
// @name         大鸡鸡论坛屏蔽某些人
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  拒绝标题党,拒绝无用垃圾信息
// @author       xinghehy
// @match       *://assbbs.com/*
// ==/UserScript==

(function() {
  var uidList = ["1", "2"]; // 设置要屏蔽的 uid 列表
  var showBlockedContent = true; // 设置是否显示被屏蔽的内容 true / false

  var liElements = document.querySelectorAll('.media.thread.tap');
  liElements.forEach(function(liElement) {
    var tid = liElement.getAttribute('data-tid'); // 获取帖子 ID
    var uidElement = liElement.querySelector('.username.text-grey[uid]'); // 获取用户 ID 元素
    var uid = uidElement ? uidElement.getAttribute('uid') : ""; // 获取用户 ID

    if (uidList.includes(uid)) {
      if (!showBlockedContent) {
        liElement.style.display = 'none';
      } else {
        var spanElement = document.createElement('span');
        spanElement.textContent = "已屏蔽 uid:" + uid;
        liElement.innerHTML = "";
        liElement.appendChild(spanElement);
      }
      console.log("已屏蔽此页 tid 为 " + tid + ",uid 为 " + uid + " 的信息");
    }
  });
})();

最新回复 (3)
  • CF 5月前
    2

    感觉可以整一个黑名单插件

    屌丝论坛第二帅|☁云库☁ - Xiuno原创插件下载:https://cloudatabases.com
  • zeg922 5月前
    3

    QQ截图20231201204255.webp

     

    很好很好

  • odinad 2天前
    4

    非常好

    屌丝一个,像你们
返回
发新帖