Skip to content

Commit 7bf05c9

Browse files
committed
fix: catch a Promise related to Ad-Shield
1 parent 15a1f59 commit 7bf05c9

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@list-kr/tinyshield",
3-
"version": "1.0.7",
3+
"version": "1.0.8",
44
"description": "",
55
"type": "module",
66
"scripts": {

sources/banner.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// @downloadURL https://cdn.jsdelivr.net/npm/@list-kr/tinyshield@latest/dist/tinyShield.user.js
99
// @license MIT
1010
//
11-
// @version 1.0.7
11+
// @version 1.0.8
1212
// @author PiQuark6046 and contributors
1313
//
1414
// @match https://ygosu.com/*

sources/src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ Win.Function.prototype.toString = new Proxy(Win.Function.prototype.toString, {
2222
Win.Function.prototype.apply = new Proxy(Win.Function.prototype.apply, {
2323
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
2424
apply(Target: typeof Function.prototype.apply, ThisArg: Function, Args: unknown[]) {
25-
if ((OrignalFunctionToString.call(ThisArg) as string).includes(',inventoryId:')) {
25+
let FunctionText = OrignalFunctionToString.call(ThisArg) as string
26+
if (FunctionText.includes(',inventoryId:') || FunctionText.includes(':if("#adshield"===')) {
2627
throw new Error()
2728
}
2829

0 commit comments

Comments
 (0)