@filteringdev/tinyshield 1.8.3 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,7 +8,7 @@
8
8
  // @downloadURL https://cdn.jsdelivr.net/npm/@filteringdev/tinyshield@latest/dist/tinyShield.user.js
9
9
  // @license MIT
10
10
  //
11
- // @version 1.8.3
11
+ // @version 2.0.0
12
12
  // @author PiQuark6046 and contributors
13
13
  //
14
14
  // @match *://ygosu.com/*
@@ -1526,4 +1526,4 @@
1526
1526
  // @grant unsafeWindow
1527
1527
  // @run-at document-start
1528
1528
  // ==/UserScript==
1529
- (()=>{var Win=typeof unsafeWindow<"u"?unsafeWindow:window,OriginalArrayToString=Win.Array.prototype.toString,OriginalRegExpTest=Win.RegExp.prototype.test,ProtectedFunctionStrings=["toString","get","set"];Win.Function.prototype.toString=new Proxy(Win.Function.prototype.toString,{apply(Target,ThisArg,Args){return ProtectedFunctionStrings.includes(ThisArg.name)?`function ${ThisArg.name}() { [native code] }`:Reflect.apply(Target,ThisArg,Args)}});var ASInitPositiveRegExps=[[/[a-zA-Z0-9]+ *=> *{ *const *[a-zA-Z0-9]+ *= *[a-zA-Z0-9]+ *; *if/,/===? *[a-zA-Z0-9]+ *\[ *[a-zA-Z0-9]+\( *[0-9a-z]+ *\) *\] *\) *return *[a-zA-Z0-9]+ *\( *{ *('|")?inventoryId('|")? *:/,/{ *('|")?inventoryId('|")? *: *this *\[[a-zA-Z0-9]+ *\( *[0-9a-z]+ *\) *\] *, *\.\.\. *[a-zA-Z0-9]+ *\[ *[a-zA-Z0-9]+ *\( *[0-9a-z]+ * *\) *\] *} *\)/]];Win.Map.prototype.get=new Proxy(Win.Map.prototype.get,{apply(Target,ThisArg,Args){if(Args.length>0&&typeof Args[0]!="function")return Reflect.apply(Target,ThisArg,Args);let ArgText=OriginalArrayToString.call(Args);if(ASInitPositiveRegExps.filter(ASInitPositiveRegExp=>ASInitPositiveRegExp.filter(Index=>OriginalRegExpTest.call(Index,ArgText)).length>=2).length===1)throw console.debug("[tinyShield]: Map.prototype.get:",ThisArg,Args),new Error;return Reflect.apply(Target,ThisArg,Args)}});var ASReinsertedAdvInvenPositiveRegExps=[[/inventory_id,[a-zA-Z0-9-]+\/[a-zA-Z0-9]+\/[a-zA-Z0-9]+/]];Win.Map.prototype.set=new Proxy(Win.Map.prototype.set,{apply(Target,ThisArg,Args){let ArgText="";try{ArgText=OriginalArrayToString.call(Args)}catch{console.warn("[tinyShield]: Map.prototype.set:",ThisArg,Args)}if(ASReinsertedAdvInvenPositiveRegExps.filter(ASReinsertedAdvInvenPositiveRegExp=>ASReinsertedAdvInvenPositiveRegExp.filter(Index=>OriginalRegExpTest.call(Index,ArgText)).length>=1).length===1)throw console.debug("[tinyShield]: Map.prototype.set:",ThisArg,Args),new Error;return Reflect.apply(Target,ThisArg,Args)}});})();
1529
+ (()=>{function CountCommonStrings(ArrayA,ArrayB){let SetB=new Set(ArrayB);return new Set(ArrayA.filter(Item=>SetB.has(Item))).size}function CheckDepthInASWeakMap(Args){if(typeof Args[0]!="object"||CountCommonStrings(["device","id","imp","regs","site","source"],Object.keys(Args[0]))<5)return!1;let ASBannerFrameIdRegExp=/^[0-9]+\/[a-zA-Z0-9]+\/[a-zA-Z0-9]+\/[a-z0-9-\(\)]+\/[a-zA-Z0-9_]+_slot[0-9]+_+/;return!(typeof Object.keys(Args[0]).find(Arg=>typeof Args[0][Arg]=="object"&&Array.isArray(Args[0][Arg])&&Args[0][Arg].filter(SubArg=>typeof SubArg=="object"&&Object.keys(SubArg).filter(InnerArg=>typeof InnerArg=="string"&&OriginalRegExpTest.call(ASBannerFrameIdRegExp,InnerArg))).length>=1)>"u")}var Win=typeof unsafeWindow<"u"?unsafeWindow:window,OriginalArrayToString=Win.Array.prototype.toString,OriginalRegExpTest=Win.RegExp.prototype.test,ProtectedFunctionStrings=["toString","get","set"];Win.Function.prototype.toString=new Proxy(Win.Function.prototype.toString,{apply(Target,ThisArg,Args){return ProtectedFunctionStrings.includes(ThisArg.name)?`function ${ThisArg.name}() { [native code] }`:Reflect.apply(Target,ThisArg,Args)}});var ASInitPositiveRegExps=[[/[a-zA-Z0-9]+ *=> *{ *const *[a-zA-Z0-9]+ *= *[a-zA-Z0-9]+ *; *if/,/===? *[a-zA-Z0-9]+ *\[ *[a-zA-Z0-9]+\( *[0-9a-z]+ *\) *\] *\) *return *[a-zA-Z0-9]+ *\( *{ *('|")?inventoryId('|")? *:/,/{ *('|")?inventoryId('|")? *: *this *\[[a-zA-Z0-9]+ *\( *[0-9a-z]+ *\) *\] *, *\.\.\. *[a-zA-Z0-9]+ *\[ *[a-zA-Z0-9]+ *\( *[0-9a-z]+ * *\) *\] *} *\)/]];Win.Map.prototype.get=new Proxy(Win.Map.prototype.get,{apply(Target,ThisArg,Args){if(Args.length>0&&typeof Args[0]!="function")return Reflect.apply(Target,ThisArg,Args);let ArgText=OriginalArrayToString.call(Args);if(ASInitPositiveRegExps.filter(ASInitPositiveRegExp=>ASInitPositiveRegExp.filter(Index=>OriginalRegExpTest.call(Index,ArgText)).length>=2).length===1)throw console.debug("[tinyShield]: Map.prototype.get:",ThisArg,Args),new Error;return Reflect.apply(Target,ThisArg,Args)}});var ASReinsertedAdvInvenPositiveRegExps=[[/inventory_id,[a-zA-Z0-9-]+\/[a-zA-Z0-9]+\/[a-zA-Z0-9]+/,/inventory_id,[a-zA-Z0-9-]+\/[a-zA-Z0-9]+\/[a-zA-Z0-9]+/,/inventory_id,[a-zA-Z0-9-]+\/[a-zA-Z0-9]+\/[a-zA-Z0-9]+/],[/[a-z0-9A-Z]+\.setAttribute\( *('|")onload('|") *, *('|")! *async *function\( *\) *\{ *let */,/confirm\( *[A-Za-z0-9]+ *\) *\) *{ *const *[A-Za-z0-9]+ *= *new *[A-Za-z0-9]+\.URL\(('|")https:\/\/report\.error-report\.com\//,/\.forEach *\( *\( *[A-Za-z0-9]+ *=> *[A-Za-z0-9]+\.remove *\( *\) *\) *\) *\) *, *[0-9a-f]+ *\) *; *const *[A-Za-z0-9]+ *= *await *\( *await *fetch *\(/]];Win.Map.prototype.set=new Proxy(Win.Map.prototype.set,{apply(Target,ThisArg,Args){let ArgText="";try{ArgText=OriginalArrayToString.call(Args)}catch{console.warn("[tinyShield]: Map.prototype.set:",ThisArg,Args)}if(ASReinsertedAdvInvenPositiveRegExps.filter(ASReinsertedAdvInvenPositiveRegExp=>ASReinsertedAdvInvenPositiveRegExp.filter(Index=>OriginalRegExpTest.call(Index,ArgText)).length>=3).length===1)throw console.debug("[tinyShield]: Map.prototype.set:",ThisArg,Args),new Error;return Reflect.apply(Target,ThisArg,Args)}});Win.WeakMap.prototype.set=new Proxy(Win.WeakMap.prototype.set,{apply(Target,ThisArg,Args){if(CheckDepthInASWeakMap(Args))throw console.debug("[tinyShield]: WeakMap.prototype.set:",ThisArg,Args),new Error;return Reflect.apply(Target,ThisArg,Args)}});var ASTimerRegExps=[[/function *\( *\) *{ *const *[a-zA-Z0-9]+ *= *[a-zA-Z0-9]+ *; *for *\( *var *[a-zA-Z0-9]+ *= *[a-zA-Z0-9]+ *\[ *[a-zA-Z0-9]+ *\( *0x[a-f0-9]+ *\) *\] *,/,/ *,[a-zA-Z0-9]+ *= *new *Array *\( *[A-Za-z0-9]+ *\) *, *[A-Za-z0-9]+ *= *0x[a-f0-9]+ *; *[A-Za-z0-9]+ *< *[A-Za-z0-9]+ *; *[A-Za-z0-9]+ *\+\+ *\)/,/\) *\? *[A-Za-z0-9]+ *\[ *[A-Za-z0-9]+ *\( *0x[a-f0-9]+ *\) *\] *\[ *[A-Za-z0-9]+ *\( *0x[a-f0-9]+ *\) *\] * *\([A-Za-z0-9]+ *, *\.\.\. *[A-Za-z0-9]+ *\) *: *void *0x[a-f0-9]+/]];Win.setTimeout=new Proxy(Win.setTimeout,{apply(Target,ThisArg,Args){if(ASTimerRegExps.filter(ASTimerRegExp=>ASTimerRegExp.filter(Index=>Index.test(Args[0].toString())).length>=3).length===1){console.debug("[tinyShield]: setTimeout:",Args);return}return Reflect.apply(Target,ThisArg,Args)}});Win.setInterval=new Proxy(Win.setInterval,{apply(Target,ThisArg,Args){if(ASTimerRegExps.filter(ASTimerRegExp=>ASTimerRegExp.filter(Index=>Index.test(Args[0].toString())).length>=3).length===1){console.debug("[tinyShield]: setInterval:",Args);return}return Reflect.apply(Target,ThisArg,Args)}});})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@filteringdev/tinyshield",
3
- "version": "1.8.3",
3
+ "version": "2.0.0",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "scripts": {