Skip to content
This repository has been archived by the owner on Dec 12, 2024. It is now read-only.

Commit

Permalink
fix: Safari detection issue using try...catch trap at dogdrip.net
Browse files Browse the repository at this point in the history
  • Loading branch information
piquark6046 committed Nov 3, 2024
1 parent 3721a0a commit ffbd535
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 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/microshield",
"version": "4.12.3",
"version": "4.12.4",
"description": "",
"type": "module",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion sources/banner-ios-blocker.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/microshield@latest/dist/microShield-ios-blocker.user.js
// @license Apache-2.0
//
// @version 4.12.3
// @version 4.12.4
// @author PiQuark6046 and contributors
//
// @match *://ygosu.com/*
Expand Down
2 changes: 1 addition & 1 deletion sources/banner-ios-recovery.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/microshield@latest/dist/microShield-ios-recovery.user.js
// @license Apache-2.0
//
// @version 4.12.3
// @version 4.12.4
// @author PiQuark6046 and contributors
//
// @match *://ygosu.com/*
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/microshield@latest/dist/microShield.user.js
// @license Apache-2.0
//
// @version 4.12.3
// @version 4.12.4
// @author PiQuark6046 and contributors
//
// @match *://ygosu.com/*
Expand Down
6 changes: 6 additions & 0 deletions sources/src/utils/secret.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ export const ProtectFunction = <F extends Fomulate>(F: F, Options: ProtectedFunc
} else if (typeof Options.ReturnAs !== 'undefined' &&
MatchSpecificSeq(ErrorStackParser.parse(ErrorInstance), [/[A-Za-z]{1,3}/, /\/</, /[A-Za-z]{1,3}/, /\/</, /\/</])) {
ReturnAs = Options.ReturnAs
} else if (typeof Options.ReturnAs !== 'undefined' &&
MatchSpecificSeq(ErrorStackParser.parse(ErrorInstance), [/[A-Za-z]{1,3}/, undefined, /[A-Za-z]{1,3}/, /Promise/, /construct/])) {
ReturnAs = Options.ReturnAs
} else {
ReturnAs = 'Banned'
}
Expand All @@ -63,6 +66,9 @@ export const ProtectFunction = <F extends Fomulate>(F: F, Options: ProtectedFunc
if (IsAdShieldCall()) {
E()
}
if (Options.Name && Options.Name.startsWith('remove') && MatchSpecificSeq(ErrorStackParser.parse(ErrorInstance), [undefined, /forEach/, /[A-Za-z]{1,3}/, /[A-Za-z]{1,3}/, /[A-Za-z]{1,3}/])) {
E()
}

if (StackTraces.some(StackTrace => JSON.stringify(ErrorStackParser.parse(ErrorInstance)) === JSON.stringify(StackTrace))) {
E()
Expand Down

0 comments on commit ffbd535

Please sign in to comment.