From 1e677010f1fac219e86a109d3bc018791fe15659 Mon Sep 17 00:00:00 2001 From: kaikaiiiiiii Date: Fri, 16 Aug 2024 01:29:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=BC=E5=AE=B9=E9=BB=91=E5=90=8D=E5=8D=95?= =?UTF-8?q?=E4=B8=8E=E5=B1=8F=E8=94=BD=E8=AF=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- psnineplus.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/psnineplus.js b/psnineplus.js index b879465..ed52f4a 100644 --- a/psnineplus.js +++ b/psnineplus.js @@ -941,6 +941,7 @@ }, })); + // 更新 tipListDom,判断每个 tr[id] 紧邻的下一个元素是否为 tr[id] const refreshTrophyTip = () => { // eslint-disable-next-line no-use-before-define @@ -952,6 +953,8 @@ t.tipListDom.remove(); // 重复 remove() 无影响 } }); + filterUserPost(); + filterBlockWorld(); // eslint-disable-next-line no-use-before-define mutationOn(); }; @@ -1022,7 +1025,9 @@ const mutationOn = () => { observers.forEach((worker) => worker.observer.observe(worker.target, worker.config)); }; - const handleMutation = () => { + const handleMutation = (mutation) => { + // if mutation target is not tr, ignore + if (!mutation.target.closest('tr')) return; mutationOff(); refreshTrophyTip(); mutationOn(); @@ -1119,8 +1124,6 @@ } }); - - // 取消奖杯排序菜单的页面跳转,并重新实现排序 const sortFlag = { XMB: true, trophyType: true, percentage: true }; const sortByType = (type) => { @@ -1697,7 +1700,10 @@ FilterRegular('div.ml64>.meta>.psnnode', 'div.post'); // 主页帖回复、交易帖回复、约战帖回复 } else if (windowHref.match(/\/my\/notice/)) { FilterRegular('.psnnode', 'li'); // 消息通知 - } else if (windowHref.indexOf('trophy') > -1 || windowHref.match(/\/psnid\/[^/]+\/comment/) !== null) { + } else if (windowHref.indexOf('trophy') > -1 + || windowHref.match(/\/psnid\/[^/]+\/comment/) !== null + || windowHref.match(/psngame\/\d+\?psnid=/) !== null + ) { FilterRegular('div.ml64>.meta.pb10>.psnnode', 'li'); // 奖杯TIPS、个人主页留言 FilterRegular('ul.sonlist .content>.psnnode', 'ul.sonlist>li'); // 奖杯TIPS二级回复、个人主页留言二级回复 } else if (windowHref.match(/\/psngame\/[1-9][0-9]+\/comment/) !== null) { @@ -1737,6 +1743,7 @@ || windowHref.indexOf('trade') > -1 // 交易回复 || windowHref.match(/\/battle\/[1-9][0-9]+/) !== null // 约战回复 || windowHref.match(/\/psnid\/[^/]+\/comment/) !== null // 个人主页留言 + || windowHref.match(/psngame\/\d+\?psnid=/) !== null // 游戏奖杯页在展开 tip 后 ) { FilterWordRegular('div.ml64>div.content.pb10'); }