Skip to content

Commit 5550c5f

Browse files
committed
fix: sometimes Ad-Shield adverts are visible in iOS Safari
1 parent e10fb00 commit 5550c5f

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
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.2.1",
3+
"version": "1.3.0",
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.2.1
11+
// @version 1.3.0
1212
// @author PiQuark6046 and contributors
1313
//
1414
// @match https://ygosu.com/*

sources/src/index.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,23 @@ Win.Function.prototype.toString = new Proxy(Win.Function.prototype.toString, {
2323
Win.Map.prototype.get = new Proxy(Win.Map.prototype.get, {
2424
apply(Target: (key: unknown) => unknown, ThisArg: Map<unknown, unknown>, Args: [unknown]) {
2525
let ArgText = OriginalArrayToString.call(Args) as string
26-
console.debug(ThisArg, Args)
2726
for (const Item of ['{"inventoryId":', '({inventoryId:this']) {
2827
if (OriginalStringIncludes.call(ArgText, Item)) {
29-
console.debug('[tinyShield]:', ThisArg, Args)
28+
console.debug('[tinyShield]: Map.prototype.get:', ThisArg, Args)
29+
throw new Error()
30+
}
31+
}
32+
33+
return Reflect.apply(Target, ThisArg, Args)
34+
}
35+
})
36+
37+
Win.Map.prototype.set = new Proxy(Win.Map.prototype.set, {
38+
apply(Target: (key: unknown, value: unknown) => Map<unknown, unknown>, ThisArg: Map<unknown, unknown>, Args: [unknown, unknown]) {
39+
let ArgText = OriginalArrayToString.call(Args) as string
40+
for (const Item of ['inventory_id']) {
41+
if (OriginalStringIncludes.call(ArgText, Item)) {
42+
console.debug('[tinyShield]: Map.prototype.set:', ThisArg, Args)
3043
throw new Error()
3144
}
3245
}

0 commit comments

Comments
 (0)