Skip to content

Commit

Permalink
fix: bypass namuwiki bait
Browse files Browse the repository at this point in the history
  • Loading branch information
piquark6046 committed Dec 31, 2024
1 parent 322f711 commit ac10833
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@list-kr/namulink",
"version": "8.0.0",
"version": "8.0.1",
"description": "",
"type": "module",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion sources/banner.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// @downloadURL https://cdn.jsdelivr.net/npm/@list-kr/namulink@latest/dist/NamuLink.user.js
// @license MIT
//
// @version 8.0.0
// @version 8.0.1
// @author PiQuark6046 and contributors
//
// @match https://namu.wiki/*
Expand Down
8 changes: 8 additions & 0 deletions sources/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ Win.Proxy = new Proxy(Win.Proxy, {
if (typeof PLData === 'undefined' || PLData === null || typeof PLData !== 'object') {
continue
}
try {
if (JSON.stringify(Args[0]).match(/<[a-zA-Z]+ /).length > 20) {
PowerLinkDataIndex = -99
}
} catch {}
let PowerLinkDataIndexKey = [0, 0, 0, 0]
const PowerLinkDataIndexConst = [3, 2, 2, 1]
for (let [IKey, IValue] of Object.entries(PLData)) {
Expand All @@ -81,6 +86,9 @@ Win.Proxy = new Proxy(Win.Proxy, {
case 'object':
PowerLinkDataIndexKey[2]++
case 'number':
if ((IValue as number) > 1000) {
PowerLinkDataIndexKey[3] = -99
}
PowerLinkDataIndexKey[3]++
}
}
Expand Down

0 comments on commit ac10833

Please sign in to comment.