@filteringdev/namulink 19.3.1 → 19.4.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/namulink@latest/dist/NamuLink.user.js
9
9
  // @license MPL-2.0
10
10
  //
11
- // @version 19.3.1
11
+ // @version 19.4.0
12
12
  // @author PiQuark6046 and contributors
13
13
  //
14
14
  // @grant unsafeWindow
@@ -22,7 +22,7 @@
22
22
  // ==/UserScript==
23
23
 
24
24
 
25
- (()=>{var E=typeof unsafeWindow<"u"?unsafeWindow:window;function x(i,c="NamuLink"){let w=i.Function.prototype.call,d=i.Reflect.apply,L=i.Object.defineProperty,g=[[/function *\( *[A-Za-z0-9]+ *, *[A-Za-z0-9]+ *, *[A-Za-z0-9]+ *, *[A-Za-z0-9]+ *, *[A-Za-z0-9]+ *, *[A-Za-z0-9]+ *\) *{ *return *[A-Za-z.-9]+/,/, *[A-Za-z0-9]+ *, *[A-Za-z0-9]+ *\) *{ *return *[A-Za-z.-9]+ *\( *[0-9a-fx *+-]+ *, *[A-Za-z.-9]+ *, *[A-Za-z.-9]+ *, *[0-9a-fx *+-]+/,/return *[A-Za-z.-9]+ *\( *[0-9a-fx *+-]+ *, *[A-Za-z.-9]+ *, *[A-Za-z.-9]+ *, *[0-9a-fx *+-]+ *,[A-Za-z.-9]+ *, *[A-Za-z.-9]+ * *\) *; *}/],[/function *[A-Za-z0-9]+ *\( *[A-Za-z0-9]+ *, *[A-Za-z0-9]+ *, *[A-Za-z0-9]+ *, *[A-Za-z0-9]+ *, *[A-Za-z0-9]+ *, *[A-Za-z0-9]+ *\) *{ *return *[A-Za-z.-9]+/,/, *[A-Za-z0-9]+ *, *[A-Za-z0-9]+ *\) *{ *return *[A-Za-z.-9]+ *\( *[0-9a-fx *+-]+ *, *[A-Za-z.-9]+ *, *[A-Za-z.-9]+ *, *[0-9a-fx *+-]+/,/return *[A-Za-z.-9]+ *\( *[0-9a-fx *+-]+ *, *[A-Za-z.-9]+ *, *[A-Za-z.-9]+ *, *[0-9a-fx *+-]+ *,[A-Za-z.-9]+ *, *[A-Za-z.-9]+ * *\) *; *}/]];function h(e){if(typeof e!="object"||e===null)return null;let t=new Set,n=e._;for(;typeof n=="object"&&n!==null&&!t.has(n);){t.add(n);let o=n.vnode;if(typeof o=="object"&&o!==null){let r=o.el;if(r instanceof HTMLElement)return r}n=n.parent}return null}function z(e){if(typeof e!="object"||e===null)return null;let t=new Set,n=e._;for(;typeof n=="object"&&n!==null&&!t.has(n);){t.add(n);let o=n.render;if(typeof o=="function")return o;n=n.parent}return null}function m(e){if(typeof e!="object"||e===null)return null;let t=new Set,n=e._;for(;typeof n=="object"&&n!==null&&!t.has(n);){t.add(n);let o=n.parent;if(typeof o=="object"&&o!==null){let a=o.vnode;if(typeof a=="object"&&a!==null){let u=a.el;if(u instanceof HTMLElement)return u}}let r=n.vnode;if(typeof r=="object"&&r!==null){let a=r.el;if(a instanceof HTMLElement)return a}n=o}return null}let y=.35,P=.75,s=.04;function l(e){return Number.parseFloat(e)||0}let S=null,p=!1;i.Function.prototype.call=new Proxy(w,{apply(e,t,n){if(p)return d(e,t,n);p=!0;let o=String(t);if(o.length<500&&g.filter(r=>r.filter(a=>a.test(o)).length===r.length).length===1){let r=m(n[6]);if(r!==null&&[...r.querySelectorAll("*")].filter(a=>{if(!(a instanceof HTMLElement))return!1;let u=a.getClientRects()[0]?.height??0,f=Math.max(l(getComputedStyle(a).getPropertyValue("padding-bottom")),l(getComputedStyle(a).getPropertyValue("margin-bottom")));return u>0&&f>=u*(y-s)&&f<=u*(P+s)}).length>=1)return console.debug(`[${c}]: Function.prototype.call called for PowerLink Skeleton:`,t),S=r,i.document.dispatchEvent(new CustomEvent("PL2PlaceHolder")),i.document.dispatchEvent(new CustomEvent("PL2PlaceHolderMobile")),p=!1,d(e,()=>{},[]);console.debug(`[${c}]: Matched Function.prototype.call called, but not for PowerLink Skeleton:`,t)}return p=!1,d(e,t,n)}}),i.Object.defineProperty=new Proxy(L,{apply(e,t,n){let o=z(n[0]),r=m(n[0]),a=String(o??"");if(o!==null&&r!==null&&a.length<500&&g.filter(u=>u.filter(f=>f.test(a)).length===u.length).length===1&&[...r.querySelectorAll("*")].filter(u=>{if(!(u instanceof HTMLElement))return!1;let f=u.getClientRects()[0]?.height??0,b=Math.max(l(getComputedStyle(u).getPropertyValue("padding-bottom")),l(getComputedStyle(u).getPropertyValue("margin-bottom")));return f>0&&b>=f*(y-s)&&b<=f*(P+s)}).length>=1){console.debug(`[${c}]: Restoring renderer.call for detected PowerLink skeleton:`,n[0]),o.call=Function.prototype.call;return}return d(e,t,n)}});let k=[[/\( *\) *=> *{ *var *_0x[0-9a-z]+ *= *a0_0x[0-9a-f]+ *; *this\[ *_0x[a-z0-9]+\( *0x[0-9a-f]+ *\) *\]\(\); *}/,/\( *\) *=> *{ *var *_0x[0-9a-z]+ *= *a0_0x[0-9a-f]+ *; *this\[ *_0x[a-z0-9]+\( *0x[0-9a-f]+ *\) *\]\(\); *}/],[/\( *\) *=> *{ *var _0x[a-z0-9]+ *= *_0x[a-z0-9]+ *; *if *\( *this\[ *_0x[a-z0-9]+ *\( *0x[0-9a-f]+ *\) *\] *\) *return *clearTimeout/,/\( *0x[0-9a-f]+ *\) *\] *\) *, *void *\( *this\[ *_0x[a-z0-9]+\( *0x[0-9a-f]+ *\) *\] *= *void *\([x0-9a-f*+-]+ *\) *\) *; *this\[_0x[a-z0-9]+\( *0x[0-9a-f]+ *\) *\] *\(\) *;/]];i.setTimeout=new Proxy(i.setTimeout,{apply(e,t,n){let o=String(n[0]);return k.filter(r=>r.filter(a=>a.test(o)).length>=1).length===1?(console.debug(`[${c}]: setTimeout called for PowerLink Skeleton:`,n[0]),d(e,t,[()=>{},0])):d(e,t,n)}}),i.document.addEventListener("PL2AdvertContainer",()=>{setTimeout(()=>{let e=new Set([S]);e=new Set([...e,...[...e].flatMap(t=>[...t.querySelectorAll("*")])]),e=new Set([...e].filter(t=>l(getComputedStyle(t).getPropertyValue("border-bottom-width"))>=.5)),e=new Set([...e].filter(t=>l(getComputedStyle(t).getPropertyValue("border-left-width"))>=.5)),e=new Set([...e].filter(t=>l(getComputedStyle(t).getPropertyValue("border-right-width"))>=.5)),e=new Set([...e].filter(t=>l(getComputedStyle(t).getPropertyValue("border-top-width"))>=.5)),e=new Set([...e].filter(t=>[...t.querySelectorAll("*")].some(n=>{if(!(n instanceof HTMLElement))return!1;let o=n.getClientRects()[0]?.height??0,r=l(getComputedStyle(n).getPropertyValue("margin-bottom"));return o===0?!1:r>=o*.65&&r<=o*1.25}))),console.debug(`[${c}]: Removing PowerLink Skeleton Containers (PL2AdvertContainer):`,e),e.forEach(t=>{t.setAttribute("style","display: none !important;")})},2500)}),i.document.addEventListener("PL2PlaceHolderMobile",()=>{setTimeout(()=>{let e=new Set([...i.document.querySelectorAll("div[class] div[class] div[class] ~ div[class]")]);e=new Set([...e].filter(t=>t instanceof HTMLElement)),e=new Set([...e].filter(t=>l(getComputedStyle(t).getPropertyValue("margin-bottom"))>15||l(getComputedStyle(t).getPropertyValue("padding-top"))>20)),e=new Set([...e].filter(t=>t instanceof HTMLElement&&t.innerText.trim().length===0)),e=new Set([...e].filter(t=>[...t.querySelectorAll("*")].some(n=>n instanceof HTMLElement&&l(getComputedStyle(n).getPropertyValue("padding-top"))>=5&&l(getComputedStyle(n).getPropertyValue("padding-bottom"))>=5&&l(getComputedStyle(n).getPropertyValue("padding-left"))>=5&&l(getComputedStyle(n).getPropertyValue("padding-right"))>=5))),console.debug(`[${c}]: Removing PowerLink Skeleton Containers (PL2PlaceHolderMobile):`,e),e.forEach(t=>{t.setAttribute("style","display: none !important;")})},2500),i.document.addEventListener("PL2PlaceHolder",()=>{setTimeout(()=>{let e=new Set([...i.document.querySelectorAll("div[class] div[class] div[class] ~ div[class]")]);e=new Set([...e].filter(t=>t instanceof HTMLElement)),e=new Set([...e].filter(t=>l(getComputedStyle(t).getPropertyValue("padding-top"))>10||l(getComputedStyle(t).getPropertyValue("margin-top"))>10)),e=new Set([...e,...[...e].flatMap(t=>[...t.querySelectorAll("*:not(button)")])]),e=new Set([...e].filter(t=>t instanceof HTMLElement&&t.innerText.trim().length===0)),e=new Set([...e].filter(t=>l(getComputedStyle(t).getPropertyValue("border-bottom-width"))>=.5)),e=new Set([...e].filter(t=>l(getComputedStyle(t).getPropertyValue("border-left-width"))>=.5)),e=new Set([...e].filter(t=>l(getComputedStyle(t).getPropertyValue("border-right-width"))>=.5)),e=new Set([...e].filter(t=>l(getComputedStyle(t).getPropertyValue("border-top-width"))>=.5)),e=new Set([...e].filter(t=>l(getComputedStyle(t).getPropertyValue("transition-duration"))>=.01)),console.debug(`[${c}]: Removing PowerLink Skeleton Containers (PL2PlaceHolder):`,e),e.forEach(t=>{t.setAttribute("style","display: none !important;")})},2500)})})}x(E);})();
25
+ (()=>{var z=typeof unsafeWindow<"u"?unsafeWindow:window;function R(u,c="NamuLink"){let L=u.Function.prototype.call,f=u.Reflect.apply,h=u.Object.defineProperty,k=u.Proxy,s=[[/function *\( *[A-Za-z0-9]+ *, *[A-Za-z0-9]+ *, *[A-Za-z0-9]+ *, *[A-Za-z0-9]+ *, *[A-Za-z0-9]+ *, *[A-Za-z0-9]+ *\) *{ *return *[A-Za-z.-9]+/,/, *[A-Za-z0-9]+ *, *[A-Za-z0-9]+ *\) *{ *return *[A-Za-z.-9]+ *\( *[0-9a-fx *+-]+ *, *[A-Za-z.-9]+ *, *[A-Za-z.-9]+ *, *[0-9a-fx *+-]+/,/return *[A-Za-z.-9]+ *\( *[0-9a-fx *+-]+ *, *[A-Za-z.-9]+ *, *[A-Za-z.-9]+ *, *[0-9a-fx *+-]+ *,[A-Za-z.-9]+ *, *[A-Za-z.-9]+ * *\) *; *}/],[/function *[A-Za-z0-9]+ *\( *[A-Za-z0-9]+ *, *[A-Za-z0-9]+ *, *[A-Za-z0-9]+ *, *[A-Za-z0-9]+ *, *[A-Za-z0-9]+ *, *[A-Za-z0-9]+ *\) *{ *return *[A-Za-z.-9]+/,/, *[A-Za-z0-9]+ *, *[A-Za-z0-9]+ *\) *{ *return *[A-Za-z.-9]+ *\( *[0-9a-fx *+-]+ *, *[A-Za-z.-9]+ *, *[A-Za-z.-9]+ *, *[0-9a-fx *+-]+/,/return *[A-Za-z.-9]+ *\( *[0-9a-fx *+-]+ *, *[A-Za-z.-9]+ *, *[A-Za-z.-9]+ *, *[0-9a-fx *+-]+ *,[A-Za-z.-9]+ *, *[A-Za-z.-9]+ * *\) *; *}/]];function V(t){if(typeof t!="object"||t===null)return null;let e=new Set,n=t._;for(;typeof n=="object"&&n!==null&&!e.has(n);){e.add(n);let o=n.vnode;if(typeof o=="object"&&o!==null){let r=o.el;if(r instanceof HTMLElement)return r}n=n.parent}return null}function S(t){if(typeof t!="object"||t===null)return null;let e=new Set,n=t._;for(;typeof n=="object"&&n!==null&&!e.has(n);){e.add(n);let o=n.render;if(typeof o=="function")return o;n=n.parent}return null}function y(t){if(typeof t!="object"||t===null)return null;let e=new Set,n=t._;for(;typeof n=="object"&&n!==null&&!e.has(n);){e.add(n);let o=n.parent;if(typeof o=="object"&&o!==null){let i=o.vnode;if(typeof i=="object"&&i!==null){let a=i.el;if(a instanceof HTMLElement)return a}}let r=n.vnode;if(typeof r=="object"&&r!==null){let i=r.el;if(i instanceof HTMLElement)return i}n=o}return null}let m=.35,P=.75,p=.04;function l(t){return Number.parseFloat(t)||0}let b=null,g=!1;u.Function.prototype.call=new Proxy(L,{apply(t,e,n){if(g)return f(t,e,n);g=!0;let o=String(e);if(o.length<500&&s.filter(r=>r.filter(i=>i.test(o)).length===r.length).length===1){let r=y(n[6]);if(r!==null&&[...r.querySelectorAll("*")].filter(i=>{if(!(i instanceof HTMLElement))return!1;let a=i.getClientRects()[0]?.height??0,d=Math.max(l(getComputedStyle(i).getPropertyValue("padding-bottom")),l(getComputedStyle(i).getPropertyValue("margin-bottom")));return a>0&&d>=a*(m-p)&&d<=a*(P+p)}).length>=1)return console.debug(`[${c}]: Function.prototype.call called for PowerLink Skeleton:`,e),b=r,u.document.dispatchEvent(new CustomEvent("PL2PlaceHolder")),u.document.dispatchEvent(new CustomEvent("PL2PlaceHolderMobile")),g=!1,f(t,()=>{},[]);console.debug(`[${c}]: Matched Function.prototype.call called, but not for PowerLink Skeleton:`,e)}return g=!1,f(t,e,n)}}),u.Object.defineProperty=new Proxy(h,{apply(t,e,n){let o=S(n[0]),r=y(n[0]),i=String(o??"");if(o!==null&&r!==null&&i.length<500&&s.filter(a=>a.filter(d=>d.test(i)).length===a.length).length===1&&[...r.querySelectorAll("*")].filter(a=>{if(!(a instanceof HTMLElement))return!1;let d=a.getClientRects()[0]?.height??0,w=Math.max(l(getComputedStyle(a).getPropertyValue("padding-bottom")),l(getComputedStyle(a).getPropertyValue("margin-bottom")));return d>0&&w>=d*(m-p)&&w<=d*(P+p)}).length>=1){console.debug(`[${c}]: Restoring renderer.call for detected PowerLink skeleton:`,n[0]),o.call=Function.prototype.call;return}return f(t,e,n)}});let E=[[/\( *\) *=> *{ *var *_0x[0-9a-z]+ *= *a0_0x[0-9a-f]+ *; *this\[ *_0x[a-z0-9]+\( *0x[0-9a-f]+ *\) *\]\(\); *}/,/\( *\) *=> *{ *var *_0x[0-9a-z]+ *= *a0_0x[0-9a-f]+ *; *this\[ *_0x[a-z0-9]+\( *0x[0-9a-f]+ *\) *\]\(\); *}/],[/\( *\) *=> *{ *var _0x[a-z0-9]+ *= *_0x[a-z0-9]+ *; *if *\( *this\[ *_0x[a-z0-9]+ *\( *0x[0-9a-f]+ *\) *\] *\) *return *clearTimeout/,/\( *0x[0-9a-f]+ *\) *\] *\) *, *void *\( *this\[ *_0x[a-z0-9]+\( *0x[0-9a-f]+ *\) *\] *= *void *\([x0-9a-f*+-]+ *\) *\) *; *this\[_0x[a-z0-9]+\( *0x[0-9a-f]+ *\) *\] *\(\) *;/]];u.setTimeout=new Proxy(u.setTimeout,{apply(t,e,n){let o=String(n[0]);return E.filter(r=>r.filter(i=>i.test(o)).length>=1).length===1?(console.debug(`[${c}]: setTimeout called for PowerLink Skeleton:`,n[0]),f(t,e,[()=>{},0])):f(t,e,n)}});function x(t,e){if(typeof t!="object"||t===null)return 1;let n=new Set,o=t._;for(;typeof o=="object"&&o!==null;){if(n.has(o))return 2;n.add(o);let r=o;if(typeof r.render=="function")return r.render=e,0;o=r.parent}return 3}u.Proxy=new Proxy(k,{construct(t,e){let n=S(e[0]),o=y(e[0]),r=String(n??"");return n!==null&&o!==null&&r.length<500&&s.filter(i=>i.filter(a=>a.test(r)).length===i.length).length===1&&[...o.querySelectorAll("*")].filter(i=>{if(!(i instanceof HTMLElement))return!1;let a=i.getClientRects()[0]?.height??0,d=Math.max(l(getComputedStyle(i).getPropertyValue("padding-bottom")),l(getComputedStyle(i).getPropertyValue("margin-bottom")));return a>0&&d>=a*(m-p)&&d<=a*(P+p)}).length>=1&&(console.debug(`[${c}]: Prevented declaring render function in Vue.js 3 for detected PowerLink skeleton:`,e[0],o),x(e[0],()=>null),u.document.dispatchEvent(new CustomEvent("PL2PlaceHolderProxy"))),Reflect.construct(t,e)}}),u.document.addEventListener("PL2AdvertContainer",()=>{setTimeout(()=>{let t=new Set([b]);t=new Set([...t,...[...t].flatMap(e=>[...e.querySelectorAll("*")])]),t=new Set([...t].filter(e=>l(getComputedStyle(e).getPropertyValue("border-bottom-width"))>=.5)),t=new Set([...t].filter(e=>l(getComputedStyle(e).getPropertyValue("border-left-width"))>=.5)),t=new Set([...t].filter(e=>l(getComputedStyle(e).getPropertyValue("border-right-width"))>=.5)),t=new Set([...t].filter(e=>l(getComputedStyle(e).getPropertyValue("border-top-width"))>=.5)),t=new Set([...t].filter(e=>[...e.querySelectorAll("*")].some(n=>{if(!(n instanceof HTMLElement))return!1;let o=n.getClientRects()[0]?.height??0,r=l(getComputedStyle(n).getPropertyValue("margin-bottom"));return o===0?!1:r>=o*.65&&r<=o*1.25}))),console.debug(`[${c}]: Removing PowerLink Skeleton Containers (PL2AdvertContainer):`,t),t.forEach(e=>{e.setAttribute("style","display: none !important;")})},2500)}),u.document.addEventListener("PL2PlaceHolderMobile",()=>{setTimeout(()=>{let t=new Set([...u.document.querySelectorAll("div[class] div[class] div[class] ~ div[class]")]);t=new Set([...t].filter(e=>e instanceof HTMLElement)),t=new Set([...t].filter(e=>l(getComputedStyle(e).getPropertyValue("margin-bottom"))>15||l(getComputedStyle(e).getPropertyValue("padding-top"))>20)),t=new Set([...t].filter(e=>e instanceof HTMLElement&&e.innerText.trim().length===0)),t=new Set([...t].filter(e=>[...e.querySelectorAll("*")].some(n=>n instanceof HTMLElement&&l(getComputedStyle(n).getPropertyValue("padding-top"))>=5&&l(getComputedStyle(n).getPropertyValue("padding-bottom"))>=5&&l(getComputedStyle(n).getPropertyValue("padding-left"))>=5&&l(getComputedStyle(n).getPropertyValue("padding-right"))>=5))),console.debug(`[${c}]: Removing PowerLink Skeleton Containers (PL2PlaceHolderMobile):`,t),t.forEach(e=>{e.setAttribute("style","display: none !important;")})},2500)}),u.document.addEventListener("PL2PlaceHolder",()=>{setTimeout(()=>{let t=new Set([...u.document.querySelectorAll("div[class] div[class] div[class] ~ div[class]")]);t=new Set([...t].filter(e=>e instanceof HTMLElement)),t=new Set([...t].filter(e=>l(getComputedStyle(e).getPropertyValue("padding-top"))>10||l(getComputedStyle(e).getPropertyValue("margin-top"))>10)),t=new Set([...t,...[...t].flatMap(e=>[...e.querySelectorAll("*:not(button)")])]),t=new Set([...t].filter(e=>e instanceof HTMLElement&&e.innerText.trim().length===0)),t=new Set([...t].filter(e=>l(getComputedStyle(e).getPropertyValue("border-bottom-width"))>=.5)),t=new Set([...t].filter(e=>l(getComputedStyle(e).getPropertyValue("border-left-width"))>=.5)),t=new Set([...t].filter(e=>l(getComputedStyle(e).getPropertyValue("border-right-width"))>=.5)),t=new Set([...t].filter(e=>l(getComputedStyle(e).getPropertyValue("border-top-width"))>=.5)),t=new Set([...t].filter(e=>l(getComputedStyle(e).getPropertyValue("transition-duration"))>=.01)),console.debug(`[${c}]: Removing PowerLink Skeleton Containers (PL2PlaceHolder):`,t),t.forEach(e=>{e.setAttribute("style","display: none !important;")})},2500)}),u.document.addEventListener("PL2PlaceHolderProxy",()=>{setTimeout(()=>{let t=new Set([...u.document.querySelectorAll("div[class] div[class] div[class] ~ div[class]")]);t=new Set([...t].filter(e=>e instanceof HTMLElement)),t=new Set([...t].filter(e=>l(getComputedStyle(e).getPropertyValue("padding-top"))>=5&&l(getComputedStyle(e).getPropertyValue("padding-bottom"))>=5&&l(getComputedStyle(e).getPropertyValue("padding-left"))>=5&&l(getComputedStyle(e).getPropertyValue("padding-right"))>=5&&l(getComputedStyle(e).getPropertyValue("border-top-width"))>=.35&&l(getComputedStyle(e).getPropertyValue("border-bottom-width"))>=.35&&l(getComputedStyle(e).getPropertyValue("border-left-width"))>=.35&&l(getComputedStyle(e).getPropertyValue("border-right-width"))>=.35&&e.getClientRects()[0]?.height<=20&&e.getClientRects()[0]?.height>0)),t=new Set([...t].filter(e=>e instanceof HTMLElement&&e.innerText.trim().length===0)),console.debug(`[${c}]: Removing PowerLink Skeleton Containers (PL2PlaceHolderProxy):`,t),t.forEach(e=>{e.setAttribute("style","display: none !important;")})},2500)})}R(z);})();
26
26
  /*!
27
27
  * @license MPL-2.0
28
28
  * This Source Code Form is subject to the terms of the Mozilla Public
package/dist/index.js CHANGED
@@ -12,6 +12,7 @@ export function RunNamuLinkUserscript(BrowserWindow, UserscriptName = 'NamuLink'
12
12
  const OriginalFunctionPrototypeCall = BrowserWindow.Function.prototype.call;
13
13
  const OriginalReflectApply = BrowserWindow.Reflect.apply;
14
14
  const OriginalObjectDefineProperty = BrowserWindow.Object.defineProperty;
15
+ const OriginalProxy = BrowserWindow.Proxy;
15
16
  const PL2MajorFuncCallPatterns = [[
16
17
  /function *\( *[A-Za-z0-9]+ *, *[A-Za-z0-9]+ *, *[A-Za-z0-9]+ *, *[A-Za-z0-9]+ *, *[A-Za-z0-9]+ *, *[A-Za-z0-9]+ *\) *{ *return *[A-Za-z.-9]+/,
17
18
  /, *[A-Za-z0-9]+ *, *[A-Za-z0-9]+ *\) *{ *return *[A-Za-z.-9]+ *\( *[0-9a-fx *+-]+ *, *[A-Za-z.-9]+ *, *[A-Za-z.-9]+ *, *[0-9a-fx *+-]+/,
@@ -162,6 +163,48 @@ export function RunNamuLinkUserscript(BrowserWindow, UserscriptName = 'NamuLink'
162
163
  return OriginalReflectApply(Target, ThisArg, Args);
163
164
  }
164
165
  });
166
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
167
+ function PowerLinkOverrideRenderFromArg(Arg, Override) {
168
+ if (typeof Arg !== 'object' || Arg === null)
169
+ return 1;
170
+ const Visited = new Set();
171
+ let Current = Arg['_'];
172
+ while (typeof Current === 'object' && Current !== null) {
173
+ if (Visited.has(Current))
174
+ return 2;
175
+ Visited.add(Current);
176
+ const RecordCurrent = Current;
177
+ const Render = RecordCurrent['render'];
178
+ if (typeof Render === 'function') {
179
+ RecordCurrent['render'] = Override;
180
+ return 0;
181
+ }
182
+ Current = RecordCurrent['parent'];
183
+ }
184
+ return 3;
185
+ }
186
+ BrowserWindow.Proxy = new Proxy(OriginalProxy, {
187
+ construct(Target, Args) {
188
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
189
+ let VuejsRenderer = PowerLinkRenderFromArg(Args[0]);
190
+ let PL2Element = PowerLinkElementFromArgParent(Args[0]);
191
+ let Stringified = String(VuejsRenderer ?? '');
192
+ if (VuejsRenderer !== null && PL2Element !== null && Stringified.length < 500 &&
193
+ PL2MajorFuncCallPatterns.filter(Patterns => Patterns.filter(Pattern => Pattern.test(Stringified)).length === Patterns.length).length === 1 &&
194
+ [...PL2Element.querySelectorAll('*')].filter(Child => {
195
+ if (!(Child instanceof HTMLElement))
196
+ return false;
197
+ let PL2TitleHeight = Child.getClientRects()[0]?.height ?? 0;
198
+ let PL2TitleMarginBottom = Math.max(ParseCssFloat(getComputedStyle(Child).getPropertyValue('padding-bottom')), ParseCssFloat(getComputedStyle(Child).getPropertyValue('margin-bottom')));
199
+ return PL2TitleHeight > 0 && PL2TitleMarginBottom >= PL2TitleHeight * (MinRatio - EpsilonRatio) && PL2TitleMarginBottom <= PL2TitleHeight * (MaxRatio + EpsilonRatio);
200
+ }).length >= 1) {
201
+ console.debug(`[${UserscriptName}]: Prevented declaring render function in Vue.js 3 for detected PowerLink skeleton:`, Args[0], PL2Element);
202
+ PowerLinkOverrideRenderFromArg(Args[0], () => null);
203
+ BrowserWindow.document.dispatchEvent(new CustomEvent('PL2PlaceHolderProxy'));
204
+ }
205
+ return Reflect.construct(Target, Args);
206
+ }
207
+ });
165
208
  BrowserWindow.document.addEventListener('PL2AdvertContainer', () => {
166
209
  setTimeout(() => {
167
210
  let ContainerElements = new Set([CommentContainer]);
@@ -202,27 +245,49 @@ export function RunNamuLinkUserscript(BrowserWindow, UserscriptName = 'NamuLink'
202
245
  Container.setAttribute('style', 'display: none !important;');
203
246
  });
204
247
  }, 2500);
205
- BrowserWindow.document.addEventListener('PL2PlaceHolder', () => {
206
- setTimeout(() => {
207
- let ContainerElements = new Set([...BrowserWindow.document.querySelectorAll('div[class] div[class] div[class] ~ div[class]')]);
208
- ContainerElements = new Set([...ContainerElements].filter(Container => Container instanceof HTMLElement));
209
- ContainerElements = new Set([...ContainerElements].filter(Container => {
210
- return ParseCssFloat(getComputedStyle(Container).getPropertyValue('padding-top')) > 10 ||
211
- ParseCssFloat(getComputedStyle(Container).getPropertyValue('margin-top')) > 10;
212
- }));
213
- ContainerElements = new Set([...ContainerElements, ...[...ContainerElements].flatMap(Container => [...Container.querySelectorAll('*:not(button)')])]);
214
- ContainerElements = new Set([...ContainerElements].filter(Container => Container instanceof HTMLElement && Container.innerText.trim().length === 0));
215
- ContainerElements = new Set([...ContainerElements].filter(Container => ParseCssFloat(getComputedStyle(Container).getPropertyValue('border-bottom-width')) >= 0.5));
216
- ContainerElements = new Set([...ContainerElements].filter(Container => ParseCssFloat(getComputedStyle(Container).getPropertyValue('border-left-width')) >= 0.5));
217
- ContainerElements = new Set([...ContainerElements].filter(Container => ParseCssFloat(getComputedStyle(Container).getPropertyValue('border-right-width')) >= 0.5));
218
- ContainerElements = new Set([...ContainerElements].filter(Container => ParseCssFloat(getComputedStyle(Container).getPropertyValue('border-top-width')) >= 0.5));
219
- ContainerElements = new Set([...ContainerElements].filter(Container => ParseCssFloat(getComputedStyle(Container).getPropertyValue('transition-duration')) >= 0.01));
220
- console.debug(`[${UserscriptName}]: Removing PowerLink Skeleton Containers (PL2PlaceHolder):`, ContainerElements);
221
- ContainerElements.forEach(Container => {
222
- Container.setAttribute('style', 'display: none !important;');
223
- });
224
- }, 2500);
225
- });
248
+ });
249
+ BrowserWindow.document.addEventListener('PL2PlaceHolder', () => {
250
+ setTimeout(() => {
251
+ let ContainerElements = new Set([...BrowserWindow.document.querySelectorAll('div[class] div[class] div[class] ~ div[class]')]);
252
+ ContainerElements = new Set([...ContainerElements].filter(Container => Container instanceof HTMLElement));
253
+ ContainerElements = new Set([...ContainerElements].filter(Container => {
254
+ return ParseCssFloat(getComputedStyle(Container).getPropertyValue('padding-top')) > 10 ||
255
+ ParseCssFloat(getComputedStyle(Container).getPropertyValue('margin-top')) > 10;
256
+ }));
257
+ ContainerElements = new Set([...ContainerElements, ...[...ContainerElements].flatMap(Container => [...Container.querySelectorAll('*:not(button)')])]);
258
+ ContainerElements = new Set([...ContainerElements].filter(Container => Container instanceof HTMLElement && Container.innerText.trim().length === 0));
259
+ ContainerElements = new Set([...ContainerElements].filter(Container => ParseCssFloat(getComputedStyle(Container).getPropertyValue('border-bottom-width')) >= 0.5));
260
+ ContainerElements = new Set([...ContainerElements].filter(Container => ParseCssFloat(getComputedStyle(Container).getPropertyValue('border-left-width')) >= 0.5));
261
+ ContainerElements = new Set([...ContainerElements].filter(Container => ParseCssFloat(getComputedStyle(Container).getPropertyValue('border-right-width')) >= 0.5));
262
+ ContainerElements = new Set([...ContainerElements].filter(Container => ParseCssFloat(getComputedStyle(Container).getPropertyValue('border-top-width')) >= 0.5));
263
+ ContainerElements = new Set([...ContainerElements].filter(Container => ParseCssFloat(getComputedStyle(Container).getPropertyValue('transition-duration')) >= 0.01));
264
+ console.debug(`[${UserscriptName}]: Removing PowerLink Skeleton Containers (PL2PlaceHolder):`, ContainerElements);
265
+ ContainerElements.forEach(Container => {
266
+ Container.setAttribute('style', 'display: none !important;');
267
+ });
268
+ }, 2500);
269
+ });
270
+ BrowserWindow.document.addEventListener('PL2PlaceHolderProxy', () => {
271
+ setTimeout(() => {
272
+ let ContainerElements = new Set([...BrowserWindow.document.querySelectorAll('div[class] div[class] div[class] ~ div[class]')]);
273
+ ContainerElements = new Set([...ContainerElements].filter(Container => Container instanceof HTMLElement));
274
+ ContainerElements = new Set([...ContainerElements].filter(Container => {
275
+ return ParseCssFloat(getComputedStyle(Container).getPropertyValue('padding-top')) >= 5 &&
276
+ ParseCssFloat(getComputedStyle(Container).getPropertyValue('padding-bottom')) >= 5 &&
277
+ ParseCssFloat(getComputedStyle(Container).getPropertyValue('padding-left')) >= 5 &&
278
+ ParseCssFloat(getComputedStyle(Container).getPropertyValue('padding-right')) >= 5 &&
279
+ ParseCssFloat(getComputedStyle(Container).getPropertyValue('border-top-width')) >= 0.35 &&
280
+ ParseCssFloat(getComputedStyle(Container).getPropertyValue('border-bottom-width')) >= 0.35 &&
281
+ ParseCssFloat(getComputedStyle(Container).getPropertyValue('border-left-width')) >= 0.35 &&
282
+ ParseCssFloat(getComputedStyle(Container).getPropertyValue('border-right-width')) >= 0.35 &&
283
+ Container.getClientRects()[0]?.height <= 20 && Container.getClientRects()[0]?.height > 0;
284
+ }));
285
+ ContainerElements = new Set([...ContainerElements].filter(Container => Container instanceof HTMLElement && Container.innerText.trim().length === 0));
286
+ console.debug(`[${UserscriptName}]: Removing PowerLink Skeleton Containers (PL2PlaceHolderProxy):`, ContainerElements);
287
+ ContainerElements.forEach(Container => {
288
+ Container.setAttribute('style', 'display: none !important;');
289
+ });
290
+ }, 2500);
226
291
  });
227
292
  }
228
293
  RunNamuLinkUserscript(Win);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@filteringdev/namulink",
3
- "version": "19.3.1",
3
+ "version": "19.4.0",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "scripts": {