@filteringdev/namulink 19.6.0 → 19.7.1-build.47c8ccf525a6
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.
- package/dist/NamuLink.user.js +2 -2
- package/dist/index.js +51 -21
- package/package.json +1 -1
package/dist/NamuLink.user.js
CHANGED
|
@@ -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.
|
|
11
|
+
// @version 19.7.1-build.47c8ccf525a6
|
|
12
12
|
// @author PiQuark6046 and contributors
|
|
13
13
|
//
|
|
14
14
|
// @grant unsafeWindow
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
// ==/UserScript==
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
(()=>{var T=typeof unsafeWindow<"u"?unsafeWindow:window;function M(c,f="NamuLink"){let x=c.Function.prototype.call,d=c.Reflect.apply,j=c.Object.defineProperty,E=c.Proxy,s=c.Object.getOwnPropertyDescriptor,m=[[/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 Z(t){if(typeof t!="object"||t===null||typeof d(s,c.Object,[t,"_"])?.get=="function")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 l=o.el;if(l instanceof HTMLElement)return l}n=n.parent}return null}function k(t){if(typeof t!="object"||t===null||typeof d(s,c.Object,[t,"_"])?.get=="function")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 P(t){if(typeof t!="object"||t===null||typeof d(s,c.Object,[t,"_"])?.get=="function")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 r=i.el;if(r instanceof HTMLElement)return r}}let l=n.vnode;if(typeof l=="object"&&l!==null){let i=l.el;if(i instanceof HTMLElement)return i}n=o}return null}let b=.35,S=.75,y=.04;function u(t){return Number.parseFloat(t)||0}let w=null,g=!1;c.Function.prototype.call=new Proxy(x,{apply(t,e,n){if(g)return d(t,e,n);g=!0;let o=String(e);if(o.length<500&&m.filter(l=>l.filter(i=>i.test(o)).length===l.length).length===1){let l=P(n[6]);if(l!==null&&[...l.querySelectorAll("*")].filter(i=>{if(!(i instanceof HTMLElement))return!1;let r=i.getClientRects()[0]?.height??0,a=Math.max(u(getComputedStyle(i).getPropertyValue("padding-bottom")),u(getComputedStyle(i).getPropertyValue("margin-bottom")));return r>0&&a>=r*(b-y)&&a<=r*(S+y)}).length>=1)return console.debug(`[${f}]: Function.prototype.call called for PowerLink Skeleton:`,e),w=l,c.document.dispatchEvent(new CustomEvent("PL2PlaceHolder")),c.document.dispatchEvent(new CustomEvent("PL2PlaceHolderMobile")),g=!1,d(t,()=>{},[]);console.debug(`[${f}]: Matched Function.prototype.call called, but not for PowerLink Skeleton:`,e)}return g=!1,d(t,e,n)}}),c.Object.defineProperty=new Proxy(j,{apply(t,e,n){let o=k(n[0]),l=P(n[0]),i=String(o??"");if(o!==null&&l!==null&&i.length<500&&m.filter(r=>r.filter(a=>a.test(i)).length===r.length).length===1&&[...l.querySelectorAll("*")].filter(r=>{if(!(r instanceof HTMLElement))return!1;let a=r.getClientRects()[0]?.height??0,p=Math.max(u(getComputedStyle(r).getPropertyValue("padding-bottom")),u(getComputedStyle(r).getPropertyValue("margin-bottom")));return a>0&&p>=a*(b-y)&&p<=a*(S+y)}).length>=1){console.debug(`[${f}]: Restoring renderer.call for detected PowerLink skeleton:`,n[0]),o.call=Function.prototype.call;return}return d(t,e,n)}});let V=[[/\( *\) *=> *{ *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]+ *\) *\] *\(\) *;/]];c.setTimeout=new Proxy(c.setTimeout,{apply(t,e,n){let o=String(n[0]);return V.filter(l=>l.filter(i=>i.test(o)).length>=1).length===1?(console.debug(`[${f}]: setTimeout called for PowerLink Skeleton:`,n[0]),d(t,e,[()=>{},0])):d(t,e,n)}});function v(t,e){if(typeof t!="object"||t===null)return 1;if(typeof d(s,c.Object,[t,"_"])?.get=="function")return null;let n=new Set,o=t._;for(;typeof o=="object"&&o!==null;){if(n.has(o))return 2;n.add(o);let l=o;if(typeof l.render=="function")return l.render=e,0;o=l.parent}return 3}function z(t){if(typeof t!="object"||t===null||typeof d(s,c.Object,[t,"_"])?.get=="function")return null;let e=new Set,n=t._;for(;typeof n=="object"&&n!==null&&!e.has(n);){e.add(n);let o=n,l=o.render;if(typeof l=="function")return l;let i=o.vnode;if(typeof i=="object"&&i!==null){let r=i.type;if(typeof r=="object"&&r!==null){let a=r.render;if(typeof a=="function")return a}}n=o.parent}return null}function C(t,e){if(typeof t!="object"||t===null)return 1;if(typeof d(s,c.Object,[t,"_"])?.get=="function")return null;let n=new Set,o=t._;for(;typeof o=="object"&&o!==null;){if(n.has(o))return 2;n.add(o);let l=o,i=l.vnode;if(typeof i=="object"&&i!==null){let r=i.type;if(typeof r=="object"&&r!==null&&typeof r.render=="function")return r.render=e,0}o=l.parent}return 3}function H(t){return String(t).includes("https://ader.naver.com/")}function L(t){for(let e of Object.keys(t)){let n=t[e],o=s(t,e);if(typeof n=="object"&&n!==null&&typeof o?.get!="function"){if(L(n))return!0}else if(typeof n=="string"&&n.includes("ader.naver.com"))return!0}return!1}function h(t,e){let n=t;for(let o of Object.keys(n)){let l=n[o],i=s(t,o);if(typeof l=="object"&&l!==null&&typeof i?.get!="function"){if(h(l,e))return!0}else if(typeof l=="string"&&l.includes("ader.naver.com"))return n[o]=e,!0}return!1}let R=new Set;c.Proxy=new Proxy(E,{construct(t,e){let n=k(e[0]),o=z(e[0]),l=P(e[0]),i=String(n??"");if(n!==null&&l!==null&&i.length<500&&m.filter(r=>r.filter(a=>a.test(i)).length===r.length).length===1&&[...l.querySelectorAll("*")].filter(r=>{if(!(r instanceof HTMLElement))return!1;let a=r.getClientRects()[0]?.height??0,p=Math.max(u(getComputedStyle(r).getPropertyValue("padding-bottom")),u(getComputedStyle(r).getPropertyValue("margin-bottom")));return a>0&&p>=a*(b-y)&&p<=a*(S+y)}).length>=1)console.debug(`[${f}]: Prevented declaring render function in Vue.js 3 for detected PowerLink skeleton:`,e[0],l),R.add(n),v(e[0],()=>null),c.document.dispatchEvent(new CustomEvent("PL2PlaceHolderProxy"));else if(o!==null&&R.has(o))return console.debug(`[${f}]: Prevented declaring render function in Vue.js 3 in SPA moving for detected PowerLink skeleton:`,e[0]),C(e[0],()=>null),c.document.dispatchEvent(new CustomEvent("PL2PlaceHolderProxy")),Reflect.construct(t,e);if(typeof e[1].set=="function"){let r=e[1].set;e[1].set=function(...a){if(H(a[2])){console.debug(`[${f}]: Proxy set called for PowerLink Skeleton:`,a);return}if(L(a[0])&&Object.keys(a[0]).some(p=>typeof a[0][p]<"u"&&a[0][p]instanceof AbortController)){console.debug(`[${f}]: Proxy set called for PowerLink Skeleton (target check):`,a),c.document.dispatchEvent(new CustomEvent("PL2PlaceHolderProxy"));return}else h(a[0],"")&&console.debug(`[${f}]: Proxy set called for PowerLink Skeleton (target check and replace):`,a);return d(r,this,a)}}return Reflect.construct(t,e)}}),c.document.addEventListener("PL2AdvertContainer",()=>{setTimeout(()=>{let t=new Set([w]);t=new Set([...t,...[...t].flatMap(e=>[...e.querySelectorAll("*")])]),t=new Set([...t].filter(e=>u(getComputedStyle(e).getPropertyValue("border-bottom-width"))>=.5)),t=new Set([...t].filter(e=>u(getComputedStyle(e).getPropertyValue("border-left-width"))>=.5)),t=new Set([...t].filter(e=>u(getComputedStyle(e).getPropertyValue("border-right-width"))>=.5)),t=new Set([...t].filter(e=>u(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,l=u(getComputedStyle(n).getPropertyValue("margin-bottom"));return o===0?!1:l>=o*.65&&l<=o*1.25}))),console.debug(`[${f}]: Removing PowerLink Skeleton Containers (PL2AdvertContainer):`,t),t.forEach(e=>{e.setAttribute("style","display: none !important;")})},2500)}),c.document.addEventListener("PL2PlaceHolderMobile",()=>{setTimeout(()=>{let t=new Set([...c.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=>u(getComputedStyle(e).getPropertyValue("margin-bottom"))>15||u(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&&u(getComputedStyle(n).getPropertyValue("padding-top"))>=5&&u(getComputedStyle(n).getPropertyValue("padding-bottom"))>=5&&u(getComputedStyle(n).getPropertyValue("padding-left"))>=5&&u(getComputedStyle(n).getPropertyValue("padding-right"))>=5))),console.debug(`[${f}]: Removing PowerLink Skeleton Containers (PL2PlaceHolderMobile):`,t),t.forEach(e=>{e.setAttribute("style","display: none !important;")})},2500)}),c.document.addEventListener("PL2PlaceHolder",()=>{setTimeout(()=>{let t=new Set([...c.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=>u(getComputedStyle(e).getPropertyValue("padding-top"))>10||u(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=>u(getComputedStyle(e).getPropertyValue("border-bottom-width"))>=.5)),t=new Set([...t].filter(e=>u(getComputedStyle(e).getPropertyValue("border-left-width"))>=.5)),t=new Set([...t].filter(e=>u(getComputedStyle(e).getPropertyValue("border-right-width"))>=.5)),t=new Set([...t].filter(e=>u(getComputedStyle(e).getPropertyValue("border-top-width"))>=.5)),t=new Set([...t].filter(e=>u(getComputedStyle(e).getPropertyValue("transition-duration"))>=.01)),console.debug(`[${f}]: Removing PowerLink Skeleton Containers (PL2PlaceHolder):`,t),t.forEach(e=>{e.setAttribute("style","display: none !important;")})},2500)}),c.document.addEventListener("PL2PlaceHolderProxy",()=>{setTimeout(()=>{let t=new Set([...c.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=>u(getComputedStyle(e).getPropertyValue("padding-top"))>=5&&u(getComputedStyle(e).getPropertyValue("padding-bottom"))>=5&&u(getComputedStyle(e).getPropertyValue("padding-left"))>=5&&u(getComputedStyle(e).getPropertyValue("padding-right"))>=5&&u(getComputedStyle(e).getPropertyValue("border-top-width"))>=.35&&u(getComputedStyle(e).getPropertyValue("border-bottom-width"))>=.35&&u(getComputedStyle(e).getPropertyValue("border-left-width"))>=.35&&u(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(`[${f}]: Removing PowerLink Skeleton Containers (PL2PlaceHolderProxy):`,t),t.forEach(e=>{e.setAttribute("style","display: none !important;")})},2500)})}M(T);})();
|
|
24
|
+
(()=>{var M=typeof unsafeWindow<"u"?unsafeWindow:window;function Z(c,d="NamuLink"){let x=c.Function.prototype.call,f=c.Reflect.apply,V=c.Object.defineProperty,j=c.Proxy,s=c.Object.getOwnPropertyDescriptor,m=[[/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 T(t){if(typeof t!="object"||t===null||typeof f(s,c.Object,[t,"_"])?.get=="function")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 w(t){if(typeof t!="object"||t===null||typeof f(s,c.Object,[t,"_"])?.get=="function")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 P(t){if(typeof t!="object"||t===null||typeof f(s,c.Object,[t,"_"])?.get=="function")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 l=i.el;if(l instanceof HTMLElement)return l}}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 b=.35,S=.75,p=.04;function u(t){return Number.parseFloat(t)||0}let L=null,g=!1;c.Function.prototype.call=new Proxy(x,{apply(t,e,n){if(g)return f(t,e,n);g=!0;let o=String(e);if(o.length<500&&m.filter(r=>r.filter(i=>i.test(o)).length===r.length).length===1){let r=P(n[6]);if(r!==null&&[...r.querySelectorAll("*")].filter(i=>{if(!(i instanceof HTMLElement))return!1;let l=i.getClientRects()[0]?.height??0,a=Math.max(u(getComputedStyle(i).getPropertyValue("padding-bottom")),u(getComputedStyle(i).getPropertyValue("margin-bottom")));return l>0&&a>=l*(b-p)&&a<=l*(S+p)}).length>=1)return console.debug(`[${d}]: Function.prototype.call called for PowerLink Skeleton:`,e),L=r,c.document.dispatchEvent(new CustomEvent("PL2PlaceHolder")),c.document.dispatchEvent(new CustomEvent("PL2PlaceHolderMobile")),g=!1,f(t,()=>{},[]);console.debug(`[${d}]: Matched Function.prototype.call called, but not for PowerLink Skeleton:`,e)}return g=!1,f(t,e,n)}}),c.Object.defineProperty=new Proxy(V,{apply(t,e,n){let o=w(n[0]),r=P(n[0]),i=String(o??"");if(o!==null&&r!==null&&i.length<500&&m.filter(l=>l.filter(a=>a.test(i)).length===l.length).length===1&&[...r.querySelectorAll("*")].filter(l=>{if(!(l instanceof HTMLElement))return!1;let a=l.getClientRects()[0]?.height??0,y=Math.max(u(getComputedStyle(l).getPropertyValue("padding-bottom")),u(getComputedStyle(l).getPropertyValue("margin-bottom")));return a>0&&y>=a*(b-p)&&y<=a*(S+p)}).length>=1){console.debug(`[${d}]: Restoring renderer.call for detected PowerLink skeleton:`,n[0]),o.call=Function.prototype.call;return}return f(t,e,n)}});let v=[[/\( *\) *=> *{ *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]+ *\) *\] *\(\) *;/]];c.setTimeout=new Proxy(c.setTimeout,{apply(t,e,n){let o=String(n[0]);return v.filter(r=>r.filter(i=>i.test(o)).length>=1).length===1?(console.debug(`[${d}]: setTimeout called for PowerLink Skeleton:`,n[0]),f(t,e,[()=>{},0])):f(t,e,n)}});function E(t,e){if(typeof t!="object"||t===null)return 1;if(typeof f(s,c.Object,[t,"_"])?.get=="function")return null;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}function z(t){if(typeof t!="object"||t===null||typeof f(s,c.Object,[t,"_"])?.get=="function")return null;let e=new Set,n=t._;for(;typeof n=="object"&&n!==null&&!e.has(n);){e.add(n);let o=n,r=o.render;if(typeof r=="function")return r;let i=o.vnode;if(typeof i=="object"&&i!==null){let l=i.type;if(typeof l=="object"&&l!==null){let a=l.render;if(typeof a=="function")return a}}n=o.parent}return null}function C(t,e){if(typeof t!="object"||t===null)return 1;if(typeof f(s,c.Object,[t,"_"])?.get=="function")return null;let n=new Set,o=t._;for(;typeof o=="object"&&o!==null;){if(n.has(o))return 2;n.add(o);let r=o,i=r.vnode;if(typeof i=="object"&&i!==null){let l=i.type;if(typeof l=="object"&&l!==null&&typeof l.render=="function")return l.render=e,0}o=r.parent}return 3}function H(t){return String(t).includes("https://ader.naver.com/")}function h(t){for(let e of Object.keys(t)){let n=t[e],o=s(t,e);if(typeof n=="object"&&n!==null&&typeof o?.get!="function"){if(h(n))return!0}else if(typeof n=="string"&&n.includes("ader.naver.com"))return!0}return!1}function k(t,e){if(t===null||e===null)return t===e;if(Array.isArray(t))return Array.isArray(e)?t.length===0?!0:e.every(n=>k(t[0],n)):!1;if(typeof t=="object"){if(typeof e!="object"||Array.isArray(e)||e===null)return!1;let n=Object.values(t),o=Object.values(e),r=new Array(o.length).fill(!1);for(let i of n){let l=!1;for(let a=0;a<o.length;a++)if(!r[a]&&k(i,o[a])){r[a]=!0,l=!0;break}if(!l)return!1}return!0}return typeof t==typeof e}let R=new Set;c.Proxy=new Proxy(j,{construct(t,e){let n=w(e[0]),o=z(e[0]),r=P(e[0]),i=String(n??"");if(n!==null&&r!==null&&i.length<500&&m.filter(l=>l.filter(a=>a.test(i)).length===l.length).length===1&&[...r.querySelectorAll("*")].filter(l=>{if(!(l instanceof HTMLElement))return!1;let a=l.getClientRects()[0]?.height??0,y=Math.max(u(getComputedStyle(l).getPropertyValue("padding-bottom")),u(getComputedStyle(l).getPropertyValue("margin-bottom")));return a>0&&y>=a*(b-p)&&y<=a*(S+p)}).length>=1)console.debug(`[${d}]: Prevented declaring render function in Vue.js 3 for detected PowerLink skeleton:`,e[0],r),R.add(n),E(e[0],()=>null),c.document.dispatchEvent(new CustomEvent("PL2PlaceHolderProxy"));else if(o!==null&&R.has(o))return console.debug(`[${d}]: Prevented declaring render function in Vue.js 3 in SPA moving for detected PowerLink skeleton:`,e[0]),C(e[0],()=>null),c.document.dispatchEvent(new CustomEvent("PL2PlaceHolderProxy")),Reflect.construct(t,e);if(typeof e[1].set=="function"){let l=e[1].set;e[1].set=function(...a){if(H(a[2])){console.debug(`[${d}]: Proxy set called for PowerLink Skeleton:`,a);return}if(h(a[0])&&k({Dummy:[],PowerLinkTracking:[{Url:"",UrlObj:{Url:""}}],LayoutFormat:"",NumberKey:[0,0,0],PowerLinkText:[{Url:"",Title:"",No:0}]},a[0])){console.debug(`[${d}]: Proxy set called for PowerLink Skeleton (target check):`,a),c.document.dispatchEvent(new CustomEvent("PL2PlaceHolderProxy"));return}return f(l,this,a)}}return Reflect.construct(t,e)}}),c.document.addEventListener("PL2AdvertContainer",()=>{setTimeout(()=>{let t=new Set([L]);t=new Set([...t,...[...t].flatMap(e=>[...e.querySelectorAll("*")])]),t=new Set([...t].filter(e=>u(getComputedStyle(e).getPropertyValue("border-bottom-width"))>=.5)),t=new Set([...t].filter(e=>u(getComputedStyle(e).getPropertyValue("border-left-width"))>=.5)),t=new Set([...t].filter(e=>u(getComputedStyle(e).getPropertyValue("border-right-width"))>=.5)),t=new Set([...t].filter(e=>u(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=u(getComputedStyle(n).getPropertyValue("margin-bottom"));return o===0?!1:r>=o*.65&&r<=o*1.25}))),console.debug(`[${d}]: Removing PowerLink Skeleton Containers (PL2AdvertContainer):`,t),t.forEach(e=>{e.setAttribute("style","display: none !important;")})},2500)}),c.document.addEventListener("PL2PlaceHolderMobile",()=>{setTimeout(()=>{let t=new Set([...c.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=>u(getComputedStyle(e).getPropertyValue("margin-bottom"))>15||u(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&&u(getComputedStyle(n).getPropertyValue("padding-top"))>=5&&u(getComputedStyle(n).getPropertyValue("padding-bottom"))>=5&&u(getComputedStyle(n).getPropertyValue("padding-left"))>=5&&u(getComputedStyle(n).getPropertyValue("padding-right"))>=5))),console.debug(`[${d}]: Removing PowerLink Skeleton Containers (PL2PlaceHolderMobile):`,t),t.forEach(e=>{e.setAttribute("style","display: none !important;")})},2500)}),c.document.addEventListener("PL2PlaceHolder",()=>{setTimeout(()=>{let t=new Set([...c.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=>u(getComputedStyle(e).getPropertyValue("padding-top"))>10||u(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=>u(getComputedStyle(e).getPropertyValue("border-bottom-width"))>=.5)),t=new Set([...t].filter(e=>u(getComputedStyle(e).getPropertyValue("border-left-width"))>=.5)),t=new Set([...t].filter(e=>u(getComputedStyle(e).getPropertyValue("border-right-width"))>=.5)),t=new Set([...t].filter(e=>u(getComputedStyle(e).getPropertyValue("border-top-width"))>=.5)),t=new Set([...t].filter(e=>u(getComputedStyle(e).getPropertyValue("transition-duration"))>=.01)),console.debug(`[${d}]: Removing PowerLink Skeleton Containers (PL2PlaceHolder):`,t),t.forEach(e=>{e.setAttribute("style","display: none !important;")})},2500)}),c.document.addEventListener("PL2PlaceHolderProxy",()=>{setTimeout(()=>{let t=new Set([...c.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=>u(getComputedStyle(e).getPropertyValue("padding-top"))>=5&&u(getComputedStyle(e).getPropertyValue("padding-bottom"))>=5&&u(getComputedStyle(e).getPropertyValue("padding-left"))>=5&&u(getComputedStyle(e).getPropertyValue("padding-right"))>=5&&u(getComputedStyle(e).getPropertyValue("border-top-width"))>=.35&&u(getComputedStyle(e).getPropertyValue("border-bottom-width"))>=.35&&u(getComputedStyle(e).getPropertyValue("border-left-width"))>=.35&&u(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(`[${d}]: Removing PowerLink Skeleton Containers (PL2PlaceHolderProxy):`,t),t.forEach(e=>{e.setAttribute("style","display: none !important;")})},2500)})}Z(M);})();
|
|
25
25
|
/*!
|
|
26
26
|
* @license MPL-2.0
|
|
27
27
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
package/dist/index.js
CHANGED
|
@@ -271,25 +271,40 @@ export function RunNamuLinkUserscript(BrowserWindow, UserscriptName = 'NamuLink'
|
|
|
271
271
|
}
|
|
272
272
|
return false;
|
|
273
273
|
}
|
|
274
|
-
function
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
if (
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
if (ProxySetHandlerTargetCheckAndReplace(Value, NewValue)) {
|
|
283
|
-
return true;
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
else if (typeof Value === 'string' &&
|
|
287
|
-
Value.includes('ader.naver.com')) {
|
|
288
|
-
Record[PropertyName] = NewValue;
|
|
274
|
+
function MatchesShape(Schema, Target) {
|
|
275
|
+
if (Schema === null || Target === null) {
|
|
276
|
+
return Schema === Target;
|
|
277
|
+
}
|
|
278
|
+
if (Array.isArray(Schema)) {
|
|
279
|
+
if (!Array.isArray(Target))
|
|
280
|
+
return false;
|
|
281
|
+
if (Schema.length === 0)
|
|
289
282
|
return true;
|
|
283
|
+
return Target.every(Item => MatchesShape(Schema[0], Item));
|
|
284
|
+
}
|
|
285
|
+
if (typeof Schema === 'object') {
|
|
286
|
+
if (typeof Target !== 'object' || Array.isArray(Target))
|
|
287
|
+
return false;
|
|
288
|
+
if (Target === null)
|
|
289
|
+
return false;
|
|
290
|
+
const SchemaValues = Object.values(Schema);
|
|
291
|
+
const TargetValues = Object.values(Target);
|
|
292
|
+
const Used = new Array(TargetValues.length).fill(false);
|
|
293
|
+
for (const SchemaValue of SchemaValues) {
|
|
294
|
+
let Found = false;
|
|
295
|
+
for (let I = 0; I < TargetValues.length; I++) {
|
|
296
|
+
if (!Used[I] && MatchesShape(SchemaValue, TargetValues[I])) {
|
|
297
|
+
Used[I] = true;
|
|
298
|
+
Found = true;
|
|
299
|
+
break;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
if (!Found)
|
|
303
|
+
return false;
|
|
290
304
|
}
|
|
305
|
+
return true;
|
|
291
306
|
}
|
|
292
|
-
return
|
|
307
|
+
return typeof Schema === typeof Target;
|
|
293
308
|
}
|
|
294
309
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
|
295
310
|
let VuejsPL2Render = new Set();
|
|
@@ -328,15 +343,30 @@ export function RunNamuLinkUserscript(BrowserWindow, UserscriptName = 'NamuLink'
|
|
|
328
343
|
console.debug(`[${UserscriptName}]: Proxy set called for PowerLink Skeleton:`, SetArgs);
|
|
329
344
|
return;
|
|
330
345
|
}
|
|
331
|
-
if (ProxySetHandlerTargetCheck(SetArgs[0]) &&
|
|
332
|
-
|
|
346
|
+
if (ProxySetHandlerTargetCheck(SetArgs[0]) && MatchesShape({
|
|
347
|
+
Dummy: [],
|
|
348
|
+
PowerLinkTracking: [
|
|
349
|
+
{
|
|
350
|
+
Url: '',
|
|
351
|
+
UrlObj: {
|
|
352
|
+
Url: ''
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
],
|
|
356
|
+
LayoutFormat: '',
|
|
357
|
+
NumberKey: [0, 0, 0],
|
|
358
|
+
PowerLinkText: [
|
|
359
|
+
{
|
|
360
|
+
Url: '',
|
|
361
|
+
Title: '',
|
|
362
|
+
No: 0
|
|
363
|
+
}
|
|
364
|
+
]
|
|
365
|
+
}, SetArgs[0])) {
|
|
333
366
|
console.debug(`[${UserscriptName}]: Proxy set called for PowerLink Skeleton (target check):`, SetArgs);
|
|
334
367
|
BrowserWindow.document.dispatchEvent(new CustomEvent('PL2PlaceHolderProxy'));
|
|
335
368
|
return;
|
|
336
369
|
}
|
|
337
|
-
else if (ProxySetHandlerTargetCheckAndReplace(SetArgs[0], '')) {
|
|
338
|
-
console.debug(`[${UserscriptName}]: Proxy set called for PowerLink Skeleton (target check and replace):`, SetArgs);
|
|
339
|
-
}
|
|
340
370
|
return OriginalReflectApply(OriginalSet, this, SetArgs);
|
|
341
371
|
};
|
|
342
372
|
}
|