|
278 | 278 | listItem.forEach(function(item){ // 遍历所有帖子 |
279 | 279 | menu_value('menu_customBlockUsers').forEach(function(item1){ // 遍历用户黑名单 |
280 | 280 | let itemName = item.querySelector(list2); // 寻找用户名 |
281 | | - if (itemName && itemName.innerText === item1) { |
| 281 | + if (itemName && itemName.textContent === item1) { |
282 | 282 | console.log(`屏蔽用户:${item1}`); |
283 | 283 | item.remove(); // 删除帖子 |
284 | 284 | } |
|
294 | 294 | listItem.forEach(function(item){ // 遍历所有回复 |
295 | 295 | menu_value('menu_customBlockUsers').forEach(function(item1){ // 遍历用户黑名单 |
296 | 296 | let itemName = item.querySelector('a.xi2'); // 寻找用户名 |
297 | | - if (itemName && itemName.innerText === item1) { |
| 297 | + if (itemName && itemName.textContent === item1) { |
298 | 298 | console.log(`屏蔽用户:${item1}`); |
299 | 299 | item.remove(); // 删除回复 |
300 | 300 | } |
|
331 | 331 | listItem.forEach(function(item){ // 遍历所有帖子标题 |
332 | 332 | menu_value('menu_customBlockKeywords').forEach(function(item1){ // 遍历关键词 |
333 | 333 | let itemName = item.querySelector('a.s.xst'); // 寻找帖子标题 |
334 | | - if (itemName && itemName.innerText.indexOf(item1) > -1) { |
335 | | - console.log(`屏蔽关键词:[${item1}]`, `,帖子标题:[${itemName.innerText}]`); |
| 334 | + if (itemName && itemName.textContent.indexOf(item1) > -1) { |
| 335 | + console.log(`屏蔽关键词:[${item1}]`, `,帖子标题:[${itemName.textContent}]`); |
336 | 336 | item.remove(); // 删除帖子 |
337 | 337 | } |
338 | 338 | }) |
|
343 | 343 | // 监听插入事件(有新的回复主题,点击查看) |
344 | 344 | function blockDOMNodeInserted() { |
345 | 345 | let block = e => { |
346 | | - if (e.target.innerText && e.target.innerText.indexOf('newthread') > -1) { |
| 346 | + if (e.target.textContent && e.target.textContent.indexOf('newthread') > -1) { |
347 | 347 | setTimeout(function () { |
348 | 348 | blockUsers('forum'); // 屏蔽用户(黑名单) |
349 | 349 | blockKeywords(); // 屏蔽关键词(帖子标题) |
|
426 | 426 |
|
427 | 427 | function replyCustom_3() { |
428 | 428 | let postsubmit = document.getElementById('postsubmit'); |
429 | | - if (postsubmit && postsubmit.innerText === '\n参与/回复主题\n' || postsubmit && postsubmit.innerText === '\n发表帖子\n') { |
| 429 | + if (postsubmit && postsubmit.textContent === '\n参与/回复主题\n' || postsubmit && postsubmit.textContent === '\n发表帖子\n') { |
430 | 430 | postsubmit.onclick = function(){ |
431 | 431 | if (GM_getValue('menu_customLittleTail')) document.getElementById('e_textarea').value += GM_getValue('menu_customLittleTail').replaceAll('\\n', '\n'); |
432 | 432 | } |
|
438 | 438 | // 监听插入事件(回帖间隔) |
439 | 439 | /*function replyIntervalDOMNodeInserted() { |
440 | 440 | let replyInterval = e => { |
441 | | - if (e.target.innerHTML && e.target.innerText.indexOf('发表回复 金钱+1') > -1) { |
| 441 | + if (e.target.innerHTML && e.target.textContent.indexOf('发表回复 金钱+1') > -1) { |
442 | 442 | setTimeout(function () {GM_notification({text: '过去 60 秒了,可以回帖了~', timeout: 3500});}, 60000) |
443 | 443 | } |
444 | 444 | } |
|
459 | 459 |
|
460 | 460 | // 隐藏帖子内的 [下一页] 按钮 |
461 | 461 | function hidePgbtn() { |
462 | | - let style_hidePgbtn = document.createElement('style'); |
463 | | - style_hidePgbtn.innerHTML = `.pgbtn {display: none;}`; |
464 | | - document.head.appendChild(style_hidePgbtn); |
| 462 | + document.lastChild.appendChild(document.createElement('style')).textContent = '.pgbtn {display: none;}'; |
465 | 463 | } |
466 | 464 |
|
467 | 465 |
|
|
496 | 494 | // 显示在线状态 |
497 | 495 | function onlineStatus() { |
498 | 496 | document.querySelectorAll('[id^="favatar"]').forEach(function(item){ // 遍历所有帖子 |
499 | | - let icon = (item.querySelector('[id^="userinfo"] > .i.y em').innerText === '当前在线') ? '🌝' : '🌚'; |
| 497 | + let icon = (item.querySelector('[id^="userinfo"] > .i.y em').textContent === '当前在线') ? '🌝' : '🌚'; |
500 | 498 | let divStatus = document.createElement('div'); |
501 | 499 | divStatus.style = 'position: absolute;margin: -8px 0 0 8px;padding: 0 1px 1.2px;background-color: #ffffff;border-radius: 50%;'; |
502 | | - divStatus.innerText = icon; |
| 500 | + divStatus.textContent = icon; |
503 | 501 | let mochu = item.querySelector('.avatar'); |
504 | 502 | mochu.parentNode.insertBefore(divStatus,mochu); |
505 | 503 | }) |
|
511 | 509 | if (patt_forum.test(location.pathname) || location.search.indexOf('mod=forumdisplay') > -1){ |
512 | 510 | let tbody = document.querySelectorAll('tbody[id^="normalthread_"] .xw1'); |
513 | 511 | Array.from(tbody).forEach(function (_this) { |
514 | | - if (_this.innerText === '255') { |
| 512 | + if (_this.textContent === '255') { |
515 | 513 | _this.parentNode.parentNode.parentNode.remove(); |
516 | 514 | } |
517 | 515 | }) |
|
529 | 527 | if (document.documentElement.scrollHeight <= document.documentElement.clientHeight + scrollTop + 999) { |
530 | 528 | if (curSite.SiteTypeID === SiteType.FORUM) { // 如果是各版块帖子列表则直接点下一页就行了 |
531 | 529 | let autopbn = document.querySelector('#autopbn'); |
532 | | - if (autopbn && autopbn.innerText === "下一页 »"){ // 如果已经在加载中了,就忽略 |
| 530 | + if (autopbn && autopbn.textContent === "下一页 »"){ // 如果已经在加载中了,就忽略 |
533 | 531 | autopbn.click(); |
534 | 532 | let timer = setInterval(function(){ // 在下一页加载完成后 |
535 | | - if (document.querySelector('#autopbn').innerText === "下一页 »") { |
| 533 | + if (document.querySelector('#autopbn').textContent === "下一页 »") { |
536 | 534 | if (menu_value('menu_delate255')) delate255(); // 隐藏 255 权限帖子 |
537 | 535 | if (menu_value('menu_blockUsers')) blockUsers('forum'); // 屏蔽用户(黑名单) |
538 | 536 | if (menu_value('menu_blockKeywords')) blockKeywords(); // 屏蔽关键词(帖子标题) |
|
0 commit comments