@filteringdev/namulink 19.3.0 → 19.3.1-build.5d014907c481

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.0
11
+ // @version 19.3.1-build.5d014907c481
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 L=typeof unsafeWindow<"u"?unsafeWindow:window;function z(a,p="NamuLink"){let S=a.Function.prototype.call,c=a.Reflect.apply,x=a.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 k(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 l=n.vnode;if(typeof l=="object"&&l!==null){let o=l.el;if(o instanceof HTMLElement)return o}n=n.parent}return null}function A(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 l=n.render;if(typeof l=="function")return l;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 l=n.parent;if(typeof l=="object"&&l!==null){let r=l.vnode;if(typeof r=="object"&&r!==null){let i=r.el;if(i instanceof HTMLElement)return i}}let o=n.vnode;if(typeof o=="object"&&o!==null){let r=o.el;if(r instanceof HTMLElement)return r}n=l}return null}let s=.35,y=.75,f=.04,b=null,d=!1;a.Function.prototype.call=new Proxy(S,{apply(e,t,n){if(d)return c(e,t,n);d=!0;let l=String(t);if(l.length<500&&g.filter(o=>o.filter(r=>r.test(l)).length===o.length).length===1){let o=m(n[6]);if(o!==null&&[...o.querySelectorAll("*")].filter(r=>{if(!(r instanceof HTMLElement))return!1;let i=r.getClientRects()[0]?.height??0,u=Math.max(Number(getComputedStyle(r).getPropertyValue("padding-bottom").replaceAll(/px/g,"")),Number(getComputedStyle(r).getPropertyValue("margin-bottom").replaceAll(/px/g,"")));return i>0&&u>=i*(s-f)&&u<=i*(y+f)}).length>=1)return console.debug(`[${p}]: Function.prototype.call called for PowerLink Skeleton:`,t),b=o,a.document.dispatchEvent(new CustomEvent("PL2PlaceHolder")),a.document.dispatchEvent(new CustomEvent("PL2PlaceHolderMobile")),d=!1,c(e,()=>{},[]);console.debug(`[${p}]: Matched Function.prototype.call called, but not for PowerLink Skeleton:`,t)}return d=!1,c(e,t,n)}}),a.Object.defineProperty=new Proxy(x,{apply(e,t,n){let l=A(n[0]),o=m(n[0]),r=String(l??"");if(l!==null&&o!==null&&r.length<500&&g.filter(i=>i.filter(u=>u.test(r)).length===i.length).length===1&&[...o.querySelectorAll("*")].filter(i=>{if(!(i instanceof HTMLElement))return!1;let u=i.getClientRects()[0]?.height??0,P=Math.max(Number(getComputedStyle(i).getPropertyValue("padding-bottom").replaceAll(/px/g,"")),Number(getComputedStyle(i).getPropertyValue("margin-bottom").replaceAll(/px/g,"")));return u>0&&P>=u*(s-f)&&P<=u*(y+f)}).length>=1){console.debug(`[${p}]: Restoring renderer.call for detected PowerLink skeleton:`,n[0]),l.call=Function.prototype.call;return}return c(e,t,n)}});let w=[[/\( *\) *=> *{ *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]+ *\) *\] *\(\) *;/]];a.setTimeout=new Proxy(a.setTimeout,{apply(e,t,n){let l=String(n[0]);return w.filter(o=>o.filter(r=>r.test(l)).length>=1).length===1?(console.debug(`[${p}]: setTimeout called for PowerLink Skeleton:`,n[0]),c(e,t,[()=>{},0])):c(e,t,n)}}),a.document.addEventListener("PL2AdvertContainer",()=>{setTimeout(()=>{let e=new Set([b]);e=new Set([...e,...[...e].flatMap(t=>[...t.querySelectorAll("*")])]),e=new Set([...e].filter(t=>Number(getComputedStyle(t).getPropertyValue("border-bottom-width").replaceAll(/px/g,""))>=.5)),e=new Set([...e].filter(t=>Number(getComputedStyle(t).getPropertyValue("border-left-width").replaceAll(/px/g,""))>=.5)),e=new Set([...e].filter(t=>Number(getComputedStyle(t).getPropertyValue("border-right-width").replaceAll(/px/g,""))>=.5)),e=new Set([...e].filter(t=>Number(getComputedStyle(t).getPropertyValue("border-top-width").replaceAll(/px/g,""))>=.5)),e=new Set([...e].filter(t=>[...t.querySelectorAll("*")].some(n=>{if(!(n instanceof HTMLElement))return!1;let l=n.getClientRects()[0]?.height??0,o=Number(getComputedStyle(n).getPropertyValue("margin-bottom").replaceAll(/px/g,""));return l===0?!1:o>=l*.65&&o<=l*1.25}))),console.debug(`[${p}]: Removing PowerLink Skeleton Containers (PL2AdvertContainer):`,e),e.forEach(t=>{t.setAttribute("style","display: none !important;")})},2500)}),a.document.addEventListener("PL2PlaceHolderMobile",()=>{setTimeout(()=>{let e=new Set([...a.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=>Number(getComputedStyle(t).getPropertyValue("margin-bottom").replaceAll(/px$/g,""))>15||Number(getComputedStyle(t).getPropertyValue("padding-top").replaceAll(/px$/g,""))>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&&Number(getComputedStyle(n).getPropertyValue("padding-top").replaceAll(/px/g,""))>=5&&Number(getComputedStyle(n).getPropertyValue("padding-bottom").replaceAll(/px/g,""))>=5&&Number(getComputedStyle(n).getPropertyValue("padding-left").replaceAll(/px/g,""))>=5&&Number(getComputedStyle(n).getPropertyValue("padding-right").replaceAll(/px/g,""))>=5))),console.debug(`[${p}]: Removing PowerLink Skeleton Containers (PL2PlaceHolderMobile):`,e),e.forEach(t=>{t.setAttribute("style","display: none !important;")})},2500),a.document.addEventListener("PL2PlaceHolder",()=>{setTimeout(()=>{let e=new Set([...a.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=>Number(getComputedStyle(t).getPropertyValue("padding-top").replaceAll(/px$/g,""))>10||Number(getComputedStyle(t).getPropertyValue("margin-top").replaceAll(/px$/g,""))>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=>Number(getComputedStyle(t).getPropertyValue("border-bottom-width").replaceAll(/px/g,""))>=.5)),e=new Set([...e].filter(t=>Number(getComputedStyle(t).getPropertyValue("border-left-width").replaceAll(/px/g,""))>=.5)),e=new Set([...e].filter(t=>Number(getComputedStyle(t).getPropertyValue("border-right-width").replaceAll(/px/g,""))>=.5)),e=new Set([...e].filter(t=>Number(getComputedStyle(t).getPropertyValue("border-top-width").replaceAll(/px/g,""))>=.5)),e=new Set([...e].filter(t=>Number(getComputedStyle(t).getPropertyValue("transition-duration").replaceAll(/s$/g,""))>=.01)),console.debug(`[${p}]: Removing PowerLink Skeleton Containers (PL2PlaceHolder):`,e),e.forEach(t=>{t.setAttribute("style","display: none !important;")})},2500)})})}z(L);})();
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);})();
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
@@ -88,6 +88,9 @@ export function RunNamuLinkUserscript(BrowserWindow, UserscriptName = 'NamuLink'
88
88
  const MinRatio = 0.35;
89
89
  const MaxRatio = 0.75;
90
90
  const EpsilonRatio = 0.04;
91
+ function ParseCssFloat(Value) {
92
+ return Number.parseFloat(Value) || 0;
93
+ }
91
94
  let CommentContainer = null;
92
95
  let InHook = false;
93
96
  BrowserWindow.Function.prototype.call = new Proxy(OriginalFunctionPrototypeCall, {
@@ -104,7 +107,7 @@ export function RunNamuLinkUserscript(BrowserWindow, UserscriptName = 'NamuLink'
104
107
  if (!(Child instanceof HTMLElement))
105
108
  return false;
106
109
  let PL2TitleHeight = Child.getClientRects()[0]?.height ?? 0;
107
- let PL2TitleMarginBottom = Math.max(Number(getComputedStyle(Child).getPropertyValue('padding-bottom').replaceAll(/px/g, '')), Number(getComputedStyle(Child).getPropertyValue('margin-bottom').replaceAll(/px/g, '')));
110
+ let PL2TitleMarginBottom = Math.max(ParseCssFloat(getComputedStyle(Child).getPropertyValue('padding-bottom')), ParseCssFloat(getComputedStyle(Child).getPropertyValue('margin-bottom')));
108
111
  return PL2TitleHeight > 0 && PL2TitleMarginBottom >= PL2TitleHeight * (MinRatio - EpsilonRatio) && PL2TitleMarginBottom <= PL2TitleHeight * (MaxRatio + EpsilonRatio);
109
112
  }).length >= 1) {
110
113
  console.debug(`[${UserscriptName}]: Function.prototype.call called for PowerLink Skeleton:`, ThisArg);
@@ -132,7 +135,7 @@ export function RunNamuLinkUserscript(BrowserWindow, UserscriptName = 'NamuLink'
132
135
  if (!(Child instanceof HTMLElement))
133
136
  return false;
134
137
  let PL2TitleHeight = Child.getClientRects()[0]?.height ?? 0;
135
- let PL2TitleMarginBottom = Math.max(Number(getComputedStyle(Child).getPropertyValue('padding-bottom').replaceAll(/px/g, '')), Number(getComputedStyle(Child).getPropertyValue('margin-bottom').replaceAll(/px/g, '')));
138
+ let PL2TitleMarginBottom = Math.max(ParseCssFloat(getComputedStyle(Child).getPropertyValue('padding-bottom')), ParseCssFloat(getComputedStyle(Child).getPropertyValue('margin-bottom')));
136
139
  return PL2TitleHeight > 0 && PL2TitleMarginBottom >= PL2TitleHeight * (MinRatio - EpsilonRatio) && PL2TitleMarginBottom <= PL2TitleHeight * (MaxRatio + EpsilonRatio);
137
140
  }).length >= 1) {
138
141
  console.debug(`[${UserscriptName}]: Restoring renderer.call for detected PowerLink skeleton:`, Args[0]);
@@ -163,15 +166,15 @@ export function RunNamuLinkUserscript(BrowserWindow, UserscriptName = 'NamuLink'
163
166
  setTimeout(() => {
164
167
  let ContainerElements = new Set([CommentContainer]);
165
168
  ContainerElements = new Set([...ContainerElements, ...[...ContainerElements].flatMap(Container => [...Container.querySelectorAll('*')])]);
166
- ContainerElements = new Set([...ContainerElements].filter(Container => Number(getComputedStyle(Container).getPropertyValue('border-bottom-width').replaceAll(/px/g, '')) >= 0.5));
167
- ContainerElements = new Set([...ContainerElements].filter(Container => Number(getComputedStyle(Container).getPropertyValue('border-left-width').replaceAll(/px/g, '')) >= 0.5));
168
- ContainerElements = new Set([...ContainerElements].filter(Container => Number(getComputedStyle(Container).getPropertyValue('border-right-width').replaceAll(/px/g, '')) >= 0.5));
169
- ContainerElements = new Set([...ContainerElements].filter(Container => Number(getComputedStyle(Container).getPropertyValue('border-top-width').replaceAll(/px/g, '')) >= 0.5));
169
+ ContainerElements = new Set([...ContainerElements].filter(Container => ParseCssFloat(getComputedStyle(Container).getPropertyValue('border-bottom-width')) >= 0.5));
170
+ ContainerElements = new Set([...ContainerElements].filter(Container => ParseCssFloat(getComputedStyle(Container).getPropertyValue('border-left-width')) >= 0.5));
171
+ ContainerElements = new Set([...ContainerElements].filter(Container => ParseCssFloat(getComputedStyle(Container).getPropertyValue('border-right-width')) >= 0.5));
172
+ ContainerElements = new Set([...ContainerElements].filter(Container => ParseCssFloat(getComputedStyle(Container).getPropertyValue('border-top-width')) >= 0.5));
170
173
  ContainerElements = new Set([...ContainerElements].filter(Container => [...Container.querySelectorAll('*')].some(Child => {
171
174
  if (!(Child instanceof HTMLElement))
172
175
  return false;
173
176
  let PL2TitleHeight = Child.getClientRects()[0]?.height ?? 0;
174
- let PL2TitleMarginBottom = Number(getComputedStyle(Child).getPropertyValue('margin-bottom').replaceAll(/px/g, ''));
177
+ let PL2TitleMarginBottom = ParseCssFloat(getComputedStyle(Child).getPropertyValue('margin-bottom'));
175
178
  if (PL2TitleHeight === 0)
176
179
  return false;
177
180
  return PL2TitleMarginBottom >= PL2TitleHeight * 0.65 && PL2TitleMarginBottom <= PL2TitleHeight * 1.25;
@@ -186,14 +189,14 @@ export function RunNamuLinkUserscript(BrowserWindow, UserscriptName = 'NamuLink'
186
189
  setTimeout(() => {
187
190
  let ContainerElements = new Set([...BrowserWindow.document.querySelectorAll('div[class] div[class] div[class] ~ div[class]')]);
188
191
  ContainerElements = new Set([...ContainerElements].filter(Container => Container instanceof HTMLElement));
189
- ContainerElements = new Set([...ContainerElements].filter(Container => Number(getComputedStyle(Container).getPropertyValue('margin-bottom').replaceAll(/px$/g, '')) > 15 ||
190
- Number(getComputedStyle(Container).getPropertyValue('padding-top').replaceAll(/px$/g, '')) > 20));
192
+ ContainerElements = new Set([...ContainerElements].filter(Container => ParseCssFloat(getComputedStyle(Container).getPropertyValue('margin-bottom')) > 15 ||
193
+ ParseCssFloat(getComputedStyle(Container).getPropertyValue('padding-top')) > 20));
191
194
  ContainerElements = new Set([...ContainerElements].filter(Container => Container instanceof HTMLElement && Container.innerText.trim().length === 0));
192
195
  ContainerElements = new Set([...ContainerElements].filter(Container => [...Container.querySelectorAll('*')].some(Child => Child instanceof HTMLElement &&
193
- (Number(getComputedStyle(Child).getPropertyValue('padding-top').replaceAll(/px/g, '')) >= 5 &&
194
- Number(getComputedStyle(Child).getPropertyValue('padding-bottom').replaceAll(/px/g, '')) >= 5 &&
195
- Number(getComputedStyle(Child).getPropertyValue('padding-left').replaceAll(/px/g, '')) >= 5 &&
196
- Number(getComputedStyle(Child).getPropertyValue('padding-right').replaceAll(/px/g, '')) >= 5))));
196
+ (ParseCssFloat(getComputedStyle(Child).getPropertyValue('padding-top')) >= 5 &&
197
+ ParseCssFloat(getComputedStyle(Child).getPropertyValue('padding-bottom')) >= 5 &&
198
+ ParseCssFloat(getComputedStyle(Child).getPropertyValue('padding-left')) >= 5 &&
199
+ ParseCssFloat(getComputedStyle(Child).getPropertyValue('padding-right')) >= 5))));
197
200
  console.debug(`[${UserscriptName}]: Removing PowerLink Skeleton Containers (PL2PlaceHolderMobile):`, ContainerElements);
198
201
  ContainerElements.forEach(Container => {
199
202
  Container.setAttribute('style', 'display: none !important;');
@@ -204,16 +207,16 @@ export function RunNamuLinkUserscript(BrowserWindow, UserscriptName = 'NamuLink'
204
207
  let ContainerElements = new Set([...BrowserWindow.document.querySelectorAll('div[class] div[class] div[class] ~ div[class]')]);
205
208
  ContainerElements = new Set([...ContainerElements].filter(Container => Container instanceof HTMLElement));
206
209
  ContainerElements = new Set([...ContainerElements].filter(Container => {
207
- return Number(getComputedStyle(Container).getPropertyValue('padding-top').replaceAll(/px$/g, '')) > 10 ||
208
- Number(getComputedStyle(Container).getPropertyValue('margin-top').replaceAll(/px$/g, '')) > 10;
210
+ return ParseCssFloat(getComputedStyle(Container).getPropertyValue('padding-top')) > 10 ||
211
+ ParseCssFloat(getComputedStyle(Container).getPropertyValue('margin-top')) > 10;
209
212
  }));
210
213
  ContainerElements = new Set([...ContainerElements, ...[...ContainerElements].flatMap(Container => [...Container.querySelectorAll('*:not(button)')])]);
211
214
  ContainerElements = new Set([...ContainerElements].filter(Container => Container instanceof HTMLElement && Container.innerText.trim().length === 0));
212
- ContainerElements = new Set([...ContainerElements].filter(Container => Number(getComputedStyle(Container).getPropertyValue('border-bottom-width').replaceAll(/px/g, '')) >= 0.5));
213
- ContainerElements = new Set([...ContainerElements].filter(Container => Number(getComputedStyle(Container).getPropertyValue('border-left-width').replaceAll(/px/g, '')) >= 0.5));
214
- ContainerElements = new Set([...ContainerElements].filter(Container => Number(getComputedStyle(Container).getPropertyValue('border-right-width').replaceAll(/px/g, '')) >= 0.5));
215
- ContainerElements = new Set([...ContainerElements].filter(Container => Number(getComputedStyle(Container).getPropertyValue('border-top-width').replaceAll(/px/g, '')) >= 0.5));
216
- ContainerElements = new Set([...ContainerElements].filter(Container => Number(getComputedStyle(Container).getPropertyValue('transition-duration').replaceAll(/s$/g, '')) >= 0.01));
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));
217
220
  console.debug(`[${UserscriptName}]: Removing PowerLink Skeleton Containers (PL2PlaceHolder):`, ContainerElements);
218
221
  ContainerElements.forEach(Container => {
219
222
  Container.setAttribute('style', 'display: none !important;');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@filteringdev/namulink",
3
- "version": "19.3.0",
3
+ "version": "19.3.1-build.5d014907c481",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "scripts": {