Skip to content

Commit

Permalink
fix: find powerlink function and throw an error
Browse files Browse the repository at this point in the history
  • Loading branch information
piquark6046 committed Dec 31, 2024
1 parent 6ceb433 commit 96e9973
Show file tree
Hide file tree
Showing 3 changed files with 9 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": "10.0.0",
"version": "10.1.0",
"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 10.0.0
// @version 10.1.0
// @author PiQuark6046 and contributors
//
// @match https://namu.wiki/*
Expand Down
7 changes: 7 additions & 0 deletions sources/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ Win.Object.defineProperty = new Proxy(Win.Object.defineProperty, {
&& /^\/[0-9]+\/namuwiki\/(?!sidebar-box)/.test((Args[0] as TPowerLink).unitPath)) {
return
}
if (Args[1] === '__v_skip' && typeof Args[0] === 'object' && Args[0] !== null && 'render' in Args[0]
// eslint-disable-next-line @typescript-eslint/naming-convention
&& typeof (Args[0] as { render: unknown }).render === 'function' &&
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
((Args[0].render as Function).toString().includes('head__link') || (Args[0].render as Function).toString().includes('head__badge'))) {
throw new Error()
}
return Reflect.apply(Target, ThisArg, Args)
}
})
Expand Down

0 comments on commit 96e9973

Please sign in to comment.