diff --git a/microShield.user.js b/microShield.user.js index dbdf7f7..101d69a 100644 --- a/microShield.user.js +++ b/microShield.user.js @@ -8,7 +8,7 @@ // @downloadURL https://cdn.jsdelivr.net/gh/List-KR/microShield@latest/microShield.user.js // @license Apache-2.0 // -// @version 4.5.23 +// @version 4.5.24 // @author PiQuark6046 and contributors // // @match *://ygosu.com/* @@ -193,4 +193,4 @@ QG1"CuJ'oV(I)>lbW4D#e L6`,output:"wr275yogsj4kv03izcnx1uaqb8pflm6th",reserved1:5 `,reserved1Output:"mteqh0ys62p1fxj589ro4aunzlig3c7wbk",reserved2:56,reserved2Input:"{eF%OXrQ2>np3JN]47u",reserved2Output:"9jmanwyqx0s54zuto6h"},{id:"nloc",input:"x<[ykY%1-sK9_C0Raj#8OLl]/HwhqFU 3",output:"0ozupkrx6qjwnygl34m7i9th1f8v2bec5",reserved1:97,reserved1Input:'&m2GT5IrP" .B(o=:igbJpWnz7tcvNZ`>\n',reserved1Output:"74hfvbtcj2eroa0ul56yw3inqxkgp9m1zs",reserved2:115,reserved2Input:"uV6})Q'?D{SeAMX4;Ef",reserved2Output:"91ysxe8luorn6vpciwq"},{id:"fkad",input:"7z>g}{/W#`c[ZT&sI<2-haKXYn\no)xSFA",output:"niue8tmyacj3l91q65fxbwzrv7po2gk40",reserved1:115,reserved1Input:"1EHb.|u?p(qfPity'r6O% w=]9BJRD;:8k",reserved1Output:"phm21v9cw4b73yglnfxotazsuj8qrk650i",reserved2:104,reserved2Input:'Qj^ NCUv54le"VMm_30GL',reserved2Output:"bixqrhwn9zjm54o12fe0s"},{id:"svmm",input:`maG;FT.e2cYzV:%i})g4bp-KUZy#[h{X19o&SEAM/n"O= 05P',reserved1Output:"36qz0mv9tne7kwra5i1ujx28oyfspcglh4",reserved2:101,reserved2Input:"|` 'Rqj6CNWH]I8sx7u3f",reserved2Output:"wegyjpzux38q2a9vmifot"},{id:"cokq",input:`(r%96jVK7{kP gDhOcFs'1;M"IuQZ/yqA`,output:"izxsomqh3p8bvga49w7fy2tluc6e5n01r",reserved1:106,reserved1Input:"^zG[wm\nC`=8Bv><&]0:T L#px3Xli-n).4",reserved1Output:"p91tzx4ibshwf3qyen506ugo2mkv8lrjc7",reserved2:107,reserved2Input:"EYf?RN2a}WbU5eH_|StJo",reserved2Output:"sm8fkhrwa94y0eupj2nq1"},{id:"znbg",input:"( EHC_;s/.WgNfVl z9MYhQ}Tj:JFUS)#",output:"o5hkm78up2yxwvzsj0at1bglr6ei43ncq",reserved1:102,reserved1Input:`KZi{^4POo37nv?x&1`]2t",reserved2Output:"crxmjf7yhgt6o3p8l09iv"}];var Config={Debug:!1};var CreateDebug=Namespace=>{let Header=`[microShield:${Namespace}]`;return new Proxy(console.debug,{apply(Target,ThisArg,ArgArray){Reflect.apply(Target,ThisArg,[Header,...ArgArray])}})};var Win=typeof unsafeWindow<"u"?unsafeWindow:window,Debug=CreateDebug("secret"),Secret=browser_default({length:20}),PprintCall=(Name,WasBlocked,V)=>{Debug(WasBlocked?"-":"+","name="+Name,"v=",V,"stack=",GenerateCallStack())},ProtectFunction=(F,Options)=>new Proxy(F,{apply(Target,ThisArg,ArgArray){let E=()=>{throw PprintCall(Options.Name,!0,ArgArray),new Error};if(IsAdShieldCall()&&E(),Options.CheckArguments){for(let Arg of ArgArray.filter(Arg2=>typeof Arg2=="string"))HasSubstringSetsInString(Arg,AdshieldKeywords)&&E();for(let Arg of ArgArray.filter(Arg2=>typeof Arg2=="function"))HasSubstringSetsInString(Arg.toString(),AdshieldKeywords)&&E();for(let Arg of ArgArray.filter(Arg2=>Arg2 instanceof URL))HasSubstringSetsInString(Arg.href,AdshieldKeywords)&&E()}if(Options.CheckErrorStack&&HasSubstringSetsInString(location.hostname,Options.CheckErrorStack))for(let Arg of ArgArray.filter(Arg2=>Arg2 instanceof Error))HasSubstringSetsInString(Arg.stack??"",[...AdshieldKeywords,"microShield",`@[native code] -E@${location.protocol}//${location.hostname+location.pathname}:`])&&E();if(Options.CheckArgumentFunctions)for(let CheckFunction of Options.CheckArgumentFunctions)CheckFunction(ArgArray)||E();if(Options.CheckOutputs){let Output=Reflect.apply(Target,ThisArg,ArgArray);HasSubstringSetsInString(Output.toLowerCase(),AdshieldKeywords)&&E()}return Config.Debug&&PprintCall(Options.Name,!1,ArgArray),Reflect.apply(Target,ThisArg,ArgArray)},setPrototypeOf(Target,V){throw PprintCall(Options.Name,!0,V),new Error}}),UnprotectedFetch=fetch,ProtectedDescriptors=new Set,ProtectDescriptors=(O,Key,NewProperty)=>{if(ProtectedDescriptors.size===0){let DefineProperty=ProtectFunction(Object.defineProperty,{CheckArgumentFunctions:[]}),DefineProperties=ProtectFunction(Object.defineProperties,{CheckArgumentFunctions:[ArgArray=>{for(let TargetProperty of Object.keys(ArgArray[1]))if(ProtectedDescriptors.has(ArgArray[0][TargetProperty]))return!1;return!0}]});ProtectedDescriptors.add(DefineProperty),ProtectedDescriptors.add(DefineProperties),Object.defineProperty(Win.Object,"defineProperty",{value:DefineProperty}),Object.defineProperties(Win.Object,{defineProperty:{value:DefineProperty},defineProperties:{value:DefineProperties}})}Object.defineProperty(O,Key,{value:NewProperty}),ProtectedDescriptors.add(NewProperty)},ProtectFunctionDescriptors=(O,Key,Options)=>{let Property=O[Key];Options===void 0&&(Options={}),Options.Name===void 0&&(Options.Name=Property.name),ProtectDescriptors(O,Key,ProtectFunction(Property,Options))};var GetCachableHtml=async Url=>{let Text=await(await UnprotectedFetch(Url,{cache:"force-cache"})).text();if(Text.length===0)throw new Error("Failed to fetch resource!");return""},GetResourceToken=async ScriptUrl=>{let Text=await(await UnprotectedFetch(ScriptUrl,{cache:"force-cache"})).text(),Match=/eyJ[\w-]*\.eyJ[\w-]*\.[\w-]*/.exec(Text);if(Match===null)throw new Error("Failed to match predefined token in the script!");return Match[0]},ResolveResourceUrls=async(Html,Token)=>{let Pattern=/(resources:\/\/[^'"]+)/g,Host=GetRandomAdShieldHost(),NewHtml="",Matches=null;for(;(Matches=Pattern.exec(Html))!==null;){let Url="https://"+Host+"/resources/"+Matches[1].slice(12)+"?token="+Token;NewHtml+=await GetCachableHtml(Url).catch(Errors=>(console.error(Errors),""))}return NewHtml};var ProtectedPrefix="asdf-",ProtectStorageApis=()=>{ProtectFunctionDescriptors(window.Storage.prototype,"setItem",{CheckArgumentFunctions:[ArgArray=>!ArgArray[0].startsWith(ProtectedPrefix)||ArgArray[2]===Secret]}),ProtectFunctionDescriptors(window.Storage.prototype,"removeItem",{CheckArgumentFunctions:[ArgArray=>!ArgArray[0].startsWith(ProtectedPrefix)||ArgArray[1]===Secret]}),ProtectFunctionDescriptors(window.Storage.prototype,"clear")},Pull=Key=>localStorage.getItem(ProtectedPrefix+Key,Secret),Push=(Key,Value)=>{localStorage.setItem(ProtectedPrefix+Key,Value,Secret)};var Debug2=CreateDebug("entities");var InsertTextEntity=Entity=>{let SelectedNode=document.querySelector(Entity.Selector);if(!SelectedNode)throw new Error("The target node was not found in the frame!");SelectedNode.before(Entity.TextContent),SelectedNode.remove()},IsInstailledInAdGuardCoreLib=new Error().stack?.includes("local.adguard.org"),InsertHeadEntity=Entity=>{IsInstailledInAdGuardCoreLib&&location.hostname.includes("etoday.co.kr")&&document.querySelectorAll(".sticky-body-spacer, .sticky-body-spacer_sub").forEach(Element=>Element.classList.remove("sticky-body-spacer","sticky-body-spacer_sub")),document.head.insertAdjacentHTML("beforeend",Entity.Html)},InsertEntity=async Entity=>{Entity.Type===1?InsertHeadEntity(Entity):Entity.Type===0&&InsertTextEntity(Entity)},InsertEntities=async Entities=>Promise.allSettled(Entities.map(async Entity=>InsertEntity(Entity))),TryCachedEntities=async()=>{let Json=Pull("entity-cache-rev2");if(!Json)throw new Error("The cached entities does not exist on this browser!");let Data=JSON.parse(Json);if(Date.now()-Data.CreatedAt>1e3*60*60*24*30)throw new Error("The cached entities are too old!");if(!Data.Entities.reduce((State,Entity)=>Entity.Type===1?State+Entity.Html.length:State,0))throw new Error("The cached entities has no content!");return Debug2("restoring cached entities data=",Data),await InsertEntities(Data.Entities),!0},PutCachedEntities=Entity=>{Entity.length!==0&&Push("entity-cache-rev2",JSON.stringify({Entity,CreatedAt:Date.now()}))};var DocumentReady=async(Doc=document)=>{if(Doc.readyState==="loading")return new Promise(Resolve=>{Doc.addEventListener("readystatechange",()=>{Resolve()})})};var HardcodedEntities=[{domain:"mydaily.co.kr",css:[".header_top > .header_right { width: 180px !important; }"]}],LoadHardcoded=()=>HardcodedEntities.find(Entity=>location.hostname.includes(Entity.domain));var Debug3=CreateDebug("ztinywave"),Decode=Payload=>{let Id=Payload.slice(0,4),Key=source.find(Store=>Store.id===Id);if(!Key)throw new Error("DEFUSER_ZTINYWAVE_KEY_NOT_FOUND");let Ra=String.fromCharCode(Key.reserved1),Rb=String.fromCharCode(Key.reserved2),Unwrap=(Input,Output,Char)=>{let Index=Output.indexOf(Char);return Index>=0?Input[Index]:Char},Mode=0,Data=Payload.slice(4).split("").map(Char=>{if(!Mode){if(Char===Ra)return Mode=1,"";if(Char===Rb)return Mode=2,""}return Mode===1?(Mode=0,Key.reserved1Output.includes(Char)?Unwrap(Key.reserved1Input,Key.reserved1Output,Char):Unwrap(Key.input,Key.output,Char)+Char):Mode===2?(Mode=0,Key.reserved2Output.includes(Char)?Unwrap(Key.reserved2Input,Key.reserved2Output,Char):Unwrap(Key.input,Key.output,Char)+Char):Unwrap(Key.input,Key.output,Char)}).join("");return JSON.parse(Data)},Extract=async()=>{let Sources=[],Pick=()=>{let Targets=document.querySelectorAll('script[data]:not([data=""]),script[wp-data]:not([wp-data=""])');for(let Target of Targets){let Script=Target.getAttribute("src"),Data=Target.getAttribute("data");Script&&Data&&Sources.push({Script,Data})}};if(Pick(),Sources.length===0&&(await DocumentReady(document),Pick()),Sources.length===0)throw new Error("DEFUSER_ZTINYWAVE_TARGET_NOT_FOUND");return Sources},Tinywave=async()=>{if(await TryCachedEntities().catch(Errors=>(Debug3("Failed to initialise cached entities",Errors),!1)))return;let Entities=[],Sources=await Extract(),LoadedHardcoded=LoadHardcoded();if(LoadedHardcoded?.domain)for(let Item of LoadedHardcoded.css)Sources.push({Script:LoadedHardcoded.domain,Data:``});let SourcesResolves=Sources.map(async Source=>{Debug3("source",Source);let Payload=[{tags:Source.Data}];Source.Data.startsWith("{await DocumentReady(document);let AppenDant="";for(let TargetNode of document.querySelectorAll("script[wp-data]")){let Attribute=TargetNode.getAttribute("wp-data");if(!Attribute){Debug4("empty attribute",TargetNode);continue}let Decoded;try{Decoded=new TextDecoder().decode(Uint8Array.from(atob(Attribute),C=>C.charCodeAt(0)))}catch(e){Debug4("failed to decode base64 stream",e);continue}if(!Decoded.startsWith("<")){Debug4("failed to decode encoded text",Decoded);continue}AppenDant+=Decoded}AppenDant&&document.head.insertAdjacentHTML("beforeend",AppenDant)};var Hook=()=>{let Win2=typeof unsafeWindow<"u"?unsafeWindow:window;ProtectFunctionDescriptors(Win2,"Error"),ProtectFunctionDescriptors(Win2.EventTarget.prototype,"addEventListener"),ProtectFunctionDescriptors(Win2.MessagePort.prototype,"postMessage"),ProtectFunctionDescriptors(Win2.Element.prototype,"remove"),ProtectFunctionDescriptors(Win2.Element.prototype,"removeChild"),ProtectFunctionDescriptors(Win2.Element.prototype,"insertAdjacentElement"),ProtectFunctionDescriptors(Win2.Element.prototype,"insertAdjacentHTML"),ProtectFunctionDescriptors(Win2,"setInterval"),ProtectFunctionDescriptors(Win2,"setTimeout",{CheckArguments:!0}),ProtectFunctionDescriptors(Win2.Element.prototype,"setAttribute",{CheckArguments:!0}),ProtectFunctionDescriptors(Win2.Element.prototype,"setAttributeNS",{CheckArguments:!0}),ProtectFunctionDescriptors(Win2.document,"createElement"),ProtectFunctionDescriptors(Win2.document,"createElementNS"),ProtectFunctionDescriptors(Win2,"alert",{CheckArguments:!0}),ProtectFunctionDescriptors(Win2,"confirm",{CheckArguments:!0}),ProtectFunctionDescriptors(Win2,"atob",{CheckOutputs:!0}),ProtectFunctionDescriptors(Win2,"decodeURI"),ProtectFunctionDescriptors(Win2,"decodeURIComponent"),ProtectFunctionDescriptors(Win2.console,"log",{CheckErrorStack:["jjang0u.com"]}),ProtectStorageApis(),ProtectFunctionDescriptors(Win2,"fetch",{CheckArguments:!0})},Observe=()=>{let Debug5=CreateDebug("observe");new MutationObserver(Mutations=>{for(let Mutation of Mutations)for(let AddedNode of Mutation.addedNodes){let Matched=AddedNode instanceof HTMLElement&&HasSubstringSetsInString(AddedNode.innerHTML,AdshieldKeywords);(Matched&&location.hostname!=="text-compare.com"||Matched&&location.hostname==="text-compare.com"&&AddedNode.className!=="text-compare")&&(AddedNode.remove(),Debug5(AddedNode))}}).observe(document.body,{subtree:!0,childList:!0})},Bootstrap=()=>{Hook(),Tinywave(),BaseDrop(),DocumentReady().then(()=>{Observe()})};Bootstrap();})(); +E@${location.protocol}//${location.hostname+location.pathname}:`])&&E();if(Options.CheckArgumentFunctions)for(let CheckFunction of Options.CheckArgumentFunctions)CheckFunction(ArgArray)||E();if(Options.CheckOutputs){let Output=Reflect.apply(Target,ThisArg,ArgArray);HasSubstringSetsInString(Output.toLowerCase(),AdshieldKeywords)&&E()}return Config.Debug&&PprintCall(Options.Name,!1,ArgArray),Reflect.apply(Target,ThisArg,ArgArray)},setPrototypeOf(Target,V){throw PprintCall(Options.Name,!0,V),new Error}}),UnprotectedFetch=fetch,ProtectedDescriptors=new Set,ProtectDescriptors=(O,Key,NewProperty)=>{if(ProtectedDescriptors.size===0){let DefineProperty=ProtectFunction(Object.defineProperty,{CheckArgumentFunctions:[]}),DefineProperties=ProtectFunction(Object.defineProperties,{CheckArgumentFunctions:[ArgArray=>{for(let TargetProperty of Object.keys(ArgArray[1]))if(ProtectedDescriptors.has(ArgArray[0][TargetProperty]))return!1;return!0}]});ProtectedDescriptors.add(DefineProperty),ProtectedDescriptors.add(DefineProperties),Object.defineProperty(Win.Object,"defineProperty",{value:DefineProperty}),Object.defineProperties(Win.Object,{defineProperty:{value:DefineProperty},defineProperties:{value:DefineProperties}})}Object.defineProperty(O,Key,{value:NewProperty}),ProtectedDescriptors.add(NewProperty)},ProtectFunctionDescriptors=(O,Key,Options)=>{let Property=O[Key];Options===void 0&&(Options={}),Options.Name===void 0&&(Options.Name=Property.name),ProtectDescriptors(O,Key,ProtectFunction(Property,Options))};var GetCachableHtml=async Url=>{let Text=await(await UnprotectedFetch(Url,{cache:"force-cache"})).text();if(Text.length===0)throw new Error("Failed to fetch resource!");return""},GetResourceToken=async ScriptUrl=>{let Text=await(await UnprotectedFetch(ScriptUrl,{cache:"force-cache"})).text(),Match=/eyJ[\w-]*\.eyJ[\w-]*\.[\w-]*/.exec(Text);return Match===null?"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJuYW1lIjoiIiwiZW1haWwiOiIiLCJleHAiOjE3MjEyODcxNjQsImlhdCI6MTcyMTIwMDc2NH0.QA2UD-FsX0zEV4ROiWy_QjCS4oIurkuQ5baCgQJyYGg&20240313":Match[0]},ResolveResourceUrls=async(Html,Token)=>{let Pattern=/(resources:\/\/[^'"]+)/g,Host=GetRandomAdShieldHost(),NewHtml="",Matches=null;for(;(Matches=Pattern.exec(Html))!==null;){let Url="https://"+Host+"/resources/"+Matches[1].slice(12)+"?token="+Token;NewHtml+=await GetCachableHtml(Url).catch(Errors=>(console.error(Errors),""))}return NewHtml};var ProtectedPrefix="asdf-",ProtectStorageApis=()=>{ProtectFunctionDescriptors(window.Storage.prototype,"setItem",{CheckArgumentFunctions:[ArgArray=>!ArgArray[0].startsWith(ProtectedPrefix)||ArgArray[2]===Secret]}),ProtectFunctionDescriptors(window.Storage.prototype,"removeItem",{CheckArgumentFunctions:[ArgArray=>!ArgArray[0].startsWith(ProtectedPrefix)||ArgArray[1]===Secret]}),ProtectFunctionDescriptors(window.Storage.prototype,"clear")},Pull=Key=>localStorage.getItem(ProtectedPrefix+Key,Secret),Push=(Key,Value)=>{localStorage.setItem(ProtectedPrefix+Key,Value,Secret)};var Debug2=CreateDebug("entities");var InsertTextEntity=Entity=>{let SelectedNode=document.querySelector(Entity.Selector);if(!SelectedNode)throw new Error("The target node was not found in the frame!");SelectedNode.before(Entity.TextContent),SelectedNode.remove()},IsInstailledInAdGuardCoreLib=new Error().stack?.includes("local.adguard.org"),InsertHeadEntity=Entity=>{IsInstailledInAdGuardCoreLib&&location.hostname.includes("etoday.co.kr")&&document.querySelectorAll(".sticky-body-spacer, .sticky-body-spacer_sub").forEach(Element=>Element.classList.remove("sticky-body-spacer","sticky-body-spacer_sub")),document.head.insertAdjacentHTML("beforeend",Entity.Html)},InsertEntity=async Entity=>{Entity.Type===1?InsertHeadEntity(Entity):Entity.Type===0&&InsertTextEntity(Entity)},InsertEntities=async Entities=>Promise.allSettled(Entities.map(async Entity=>InsertEntity(Entity))),TryCachedEntities=async()=>{let Json=Pull("entity-cache-rev2");if(!Json)throw new Error("The cached entities does not exist on this browser!");let Data=JSON.parse(Json);if(Date.now()-Data.CreatedAt>1e3*60*60*24*30)throw new Error("The cached entities are too old!");if(!Data.Entities.reduce((State,Entity)=>Entity.Type===1?State+Entity.Html.length:State,0))throw new Error("The cached entities has no content!");return Debug2("restoring cached entities data=",Data),await InsertEntities(Data.Entities),!0},PutCachedEntities=Entity=>{Entity.length!==0&&Push("entity-cache-rev2",JSON.stringify({Entity,CreatedAt:Date.now()}))};var DocumentReady=async(Doc=document)=>{if(Doc.readyState==="loading")return new Promise(Resolve=>{Doc.addEventListener("readystatechange",()=>{Resolve()})})};var HardcodedEntities=[{domain:"mydaily.co.kr",css:[".header_top > .header_right { width: 180px !important; }"]}],LoadHardcoded=()=>HardcodedEntities.find(Entity=>location.hostname.includes(Entity.domain));var Debug3=CreateDebug("ztinywave"),Decode=Payload=>{let Id=Payload.slice(0,4),Key=source.find(Store=>Store.id===Id);if(!Key)throw new Error("DEFUSER_ZTINYWAVE_KEY_NOT_FOUND");let Ra=String.fromCharCode(Key.reserved1),Rb=String.fromCharCode(Key.reserved2),Unwrap=(Input,Output,Char)=>{let Index=Output.indexOf(Char);return Index>=0?Input[Index]:Char},Mode=0,Data=Payload.slice(4).split("").map(Char=>{if(!Mode){if(Char===Ra)return Mode=1,"";if(Char===Rb)return Mode=2,""}return Mode===1?(Mode=0,Key.reserved1Output.includes(Char)?Unwrap(Key.reserved1Input,Key.reserved1Output,Char):Unwrap(Key.input,Key.output,Char)+Char):Mode===2?(Mode=0,Key.reserved2Output.includes(Char)?Unwrap(Key.reserved2Input,Key.reserved2Output,Char):Unwrap(Key.input,Key.output,Char)+Char):Unwrap(Key.input,Key.output,Char)}).join("");return JSON.parse(Data)},Extract=async()=>{let Sources=[],Pick=()=>{let Targets=document.querySelectorAll('script[data]:not([data=""]),script[wp-data]:not([wp-data=""])');for(let Target of Targets){let Script=Target.getAttribute("src"),Data=Target.getAttribute("data");Script&&Data&&Sources.push({Script,Data})}};if(Pick(),Sources.length===0&&(await DocumentReady(document),Pick()),Sources.length===0)throw new Error("DEFUSER_ZTINYWAVE_TARGET_NOT_FOUND");return Sources},Tinywave=async()=>{if(await TryCachedEntities().catch(Errors=>(Debug3("Failed to initialise cached entities",Errors),!1)))return;let Entities=[],Sources=await Extract(),LoadedHardcoded=LoadHardcoded();if(LoadedHardcoded?.domain)for(let Item of LoadedHardcoded.css)Sources.push({Script:LoadedHardcoded.domain,Data:``});let SourcesResolves=Sources.map(async Source=>{Debug3("source",Source);let Payload=[{tags:Source.Data}];Source.Data.startsWith("{await DocumentReady(document);let AppenDant="";for(let TargetNode of document.querySelectorAll("script[wp-data]")){let Attribute=TargetNode.getAttribute("wp-data");if(!Attribute){Debug4("empty attribute",TargetNode);continue}let Decoded;try{Decoded=new TextDecoder().decode(Uint8Array.from(atob(Attribute),C=>C.charCodeAt(0)))}catch(e){Debug4("failed to decode base64 stream",e);continue}if(!Decoded.startsWith("<")){Debug4("failed to decode encoded text",Decoded);continue}AppenDant+=Decoded}AppenDant&&document.head.insertAdjacentHTML("beforeend",AppenDant)};var Hook=()=>{let Win2=typeof unsafeWindow<"u"?unsafeWindow:window;ProtectFunctionDescriptors(Win2,"Error"),ProtectFunctionDescriptors(Win2.EventTarget.prototype,"addEventListener"),ProtectFunctionDescriptors(Win2.MessagePort.prototype,"postMessage"),ProtectFunctionDescriptors(Win2.Element.prototype,"remove"),ProtectFunctionDescriptors(Win2.Element.prototype,"removeChild"),ProtectFunctionDescriptors(Win2.Element.prototype,"insertAdjacentElement"),ProtectFunctionDescriptors(Win2.Element.prototype,"insertAdjacentHTML"),ProtectFunctionDescriptors(Win2,"setInterval"),ProtectFunctionDescriptors(Win2,"setTimeout",{CheckArguments:!0}),ProtectFunctionDescriptors(Win2.Element.prototype,"setAttribute",{CheckArguments:!0}),ProtectFunctionDescriptors(Win2.Element.prototype,"setAttributeNS",{CheckArguments:!0}),ProtectFunctionDescriptors(Win2.document,"createElement"),ProtectFunctionDescriptors(Win2.document,"createElementNS"),ProtectFunctionDescriptors(Win2,"alert",{CheckArguments:!0}),ProtectFunctionDescriptors(Win2,"confirm",{CheckArguments:!0}),ProtectFunctionDescriptors(Win2,"atob",{CheckOutputs:!0}),ProtectFunctionDescriptors(Win2,"decodeURI"),ProtectFunctionDescriptors(Win2,"decodeURIComponent"),ProtectFunctionDescriptors(Win2.console,"log",{CheckErrorStack:["jjang0u.com"]}),ProtectStorageApis(),ProtectFunctionDescriptors(Win2,"fetch",{CheckArguments:!0})},Observe=()=>{let Debug5=CreateDebug("observe");new MutationObserver(Mutations=>{for(let Mutation of Mutations)for(let AddedNode of Mutation.addedNodes){let Matched=AddedNode instanceof HTMLElement&&HasSubstringSetsInString(AddedNode.innerHTML,AdshieldKeywords);(Matched&&location.hostname!=="text-compare.com"||Matched&&location.hostname==="text-compare.com"&&AddedNode.className!=="text-compare")&&(AddedNode.remove(),Debug5(AddedNode))}}).observe(document.body,{subtree:!0,childList:!0})},Bootstrap=()=>{Hook(),Tinywave(),BaseDrop(),DocumentReady().then(()=>{Observe()})};Bootstrap();})(); diff --git a/package.json b/package.json index e8396b1..c663452 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "microshield", - "version": "4.5.23", + "version": "4.5.24", "description": "", "type": "module", "scripts": { diff --git a/sources/banner.txt b/sources/banner.txt index 4ac0acd..7cfc57c 100644 --- a/sources/banner.txt +++ b/sources/banner.txt @@ -8,7 +8,7 @@ // @downloadURL https://cdn.jsdelivr.net/gh/List-KR/microShield@latest/microShield.user.js // @license Apache-2.0 // -// @version 4.5.23 +// @version 4.5.24 // @author PiQuark6046 and contributors // // @match *://ygosu.com/* diff --git a/sources/src/adshield/resources.ts b/sources/src/adshield/resources.ts index dc9ad12..cdf4df4 100644 --- a/sources/src/adshield/resources.ts +++ b/sources/src/adshield/resources.ts @@ -23,7 +23,7 @@ export const GetResourceToken = async (ScriptUrl: string) => { const Match = /eyJ[\w-]*\.eyJ[\w-]*\.[\w-]*/.exec(Text) if (Match === null) { - throw new Error('Failed to match predefined token in the script!') + return 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJuYW1lIjoiIiwiZW1haWwiOiIiLCJleHAiOjE3MjEyODcxNjQsImlhdCI6MTcyMTIwMDc2NH0.QA2UD-FsX0zEV4ROiWy_QjCS4oIurkuQ5baCgQJyYGg&20240313' } return Match[0]