Skip to content

Commit

Permalink
兼容黑名单与屏蔽词
Browse files Browse the repository at this point in the history
  • Loading branch information
kaikaiiiiiii committed Aug 15, 2024
1 parent b358b77 commit 1e67701
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions psnineplus.js
Original file line number Diff line number Diff line change
Expand Up @@ -941,6 +941,7 @@
},
}));


Check failure on line 944 in psnineplus.js

View workflow job for this annotation

GitHub Actions / eslint

More than 1 blank line not allowed
// 更新 tipListDom,判断每个 tr[id] 紧邻的下一个元素是否为 tr[id]
const refreshTrophyTip = () => {
// eslint-disable-next-line no-use-before-define
Expand All @@ -952,6 +953,8 @@
t.tipListDom.remove(); // 重复 remove() 无影响
}
});
filterUserPost();

Check failure on line 956 in psnineplus.js

View workflow job for this annotation

GitHub Actions / eslint

'filterUserPost' was used before it was defined
filterBlockWorld();

Check failure on line 957 in psnineplus.js

View workflow job for this annotation

GitHub Actions / eslint

'filterBlockWorld' was used before it was defined
// eslint-disable-next-line no-use-before-define
mutationOn();
};
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -1119,8 +1124,6 @@
}
});



// 取消奖杯排序菜单的页面跳转,并重新实现排序
const sortFlag = { XMB: true, trophyType: true, percentage: true };
const sortByType = (type) => {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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');
}
Expand Down

0 comments on commit 1e67701

Please sign in to comment.