| 269 | } |
| 270 | function blockUsers_vfastpost() { |
| 271 | let vfastpost = e => { |
| 272 | if (e.target.nodeType == 1 && e.target.outerHTML && e.target.outerHTML.indexOf('class="fastpreview"') > -1) { |
| 273 | e.target.querySelectorAll('.bm_c > [id^="post_"]').forEach(function (item) { // 遍历所有回复 |
| 274 | menu_value('menu_customBlockUsers').forEach(function (item1) { // 遍历用户黑名单 |
| 275 | let itemName = item.querySelector('a.xi2'); // 寻找用户名 |
| 276 | if (itemName && itemName.textContent === item1) { |
| 277 | console.log(`屏蔽用户:${item1}`); |
| 278 | item.hidden = true; // 隐藏 |
| 279 | } |
| 280 | itemName = item.querySelector('.quote>blockquote>font:first-child'); // 寻找用户名(回复引用) |
| 281 | if (itemName && itemName.textContent.split(' ')[0] === item1) { |
| 282 | console.log(`屏蔽用户:${item1}`); |
| 283 | item.querySelector('.quote').hidden = true; // 隐藏 |
| 284 | } |
| 285 | }) |
| 286 | }) |
| 287 | } |
| 288 | } |
| 289 | document.addEventListener('DOMNodeInserted', vfastpost); // 监听插入事件 |
| 290 | } |
| 291 | } |
nothing calls this directly
no test coverage detected