@filteringdev/namulink 19.7.1-build.87da8dd89b69 → 19.7.1-build.a5c3f660aa20
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 +8 -4
- 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.7.1-build.
|
|
11
|
+
// @version 19.7.1-build.a5c3f660aa20
|
|
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 Z=typeof unsafeWindow<"u"?unsafeWindow:window;function T(c,f="NamuLink"){let j=c.Function.prototype.call,d=c.Reflect.apply,V=c.Object.defineProperty,v=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 O(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 r=o.el;if(r instanceof HTMLElement)return r}n=n.parent}return null}function w(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 u=o.vnode;if(typeof u=="object"&&u!==null){let l=u.el;if(l instanceof HTMLElement)return l}}let r=n.vnode;if(typeof r=="object"&&r!==null){let u=r.el;if(u instanceof HTMLElement)return u}n=o}return null}let b=.35,S=.75,p=.04;function a(t){return Number.parseFloat(t)||0}let L=null,g=!1;c.Function.prototype.call=new Proxy(j,{apply(t,e,n){if(g)return d(t,e,n);g=!0;let o=String(e);if(o.length<500&&m.filter(r=>r.filter(u=>u.test(o)).length===r.length).length===1){let r=P(n[6]);if(r!==null&&[...r.querySelectorAll("*")].filter(u=>{if(!(u instanceof HTMLElement))return!1;let l=u.getClientRects()[0]?.height??0,i=Math.max(a(getComputedStyle(u).getPropertyValue("padding-bottom")),a(getComputedStyle(u).getPropertyValue("margin-bottom")));return l>0&&i>=l*(b-p)&&i<=l*(S+p)}).length>=1)return console.debug(`[${f}]: Function.prototype.call called for PowerLink Skeleton:`,e),L=r,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(V,{apply(t,e,n){let o=w(n[0]),r=P(n[0]),u=String(o??"");if(o!==null&&r!==null&&u.length<500&&m.filter(l=>l.filter(i=>i.test(u)).length===l.length).length===1&&[...r.querySelectorAll("*")].filter(l=>{if(!(l instanceof HTMLElement))return!1;let i=l.getClientRects()[0]?.height??0,y=Math.max(a(getComputedStyle(l).getPropertyValue("padding-bottom")),a(getComputedStyle(l).getPropertyValue("margin-bottom")));return i>0&&y>=i*(b-p)&&y<=i*(S+p)}).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 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]+ *\) *\] *\(\) *;/]];c.setTimeout=new Proxy(c.setTimeout,{apply(t,e,n){let o=String(n[0]);return E.filter(r=>r.filter(u=>u.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 z(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 r=o;if(typeof r.render=="function")return r.render=e,0;o=r.parent}return 3}function C(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,r=o.render;if(typeof r=="function")return r;let u=o.vnode;if(typeof u=="object"&&u!==null){let l=u.type;if(typeof l=="object"&&l!==null){let i=l.render;if(typeof i=="function")return i}}n=o.parent}return null}function H(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 r=o,u=r.vnode;if(typeof u=="object"&&u!==null){let l=u.type;if(typeof l=="object"&&l!==null&&typeof l.render=="function")return l.render=e,0}o=r.parent}return 3}function M(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 R(t,e){let n=t;for(let o of Object.keys(n)){let r=n[o],u=s(t,o);if(typeof r=="object"&&r!==null&&typeof u?.get!="function"){if(R(r,e))return!0}else if(typeof r=="string"&&r.includes("ader.naver.com"))return n[o]=e,!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 u of n){let l=!1;for(let i=0;i<o.length;i++)if(!r[i]&&k(u,o[i])){r[i]=!0,l=!0;break}if(!l)return!1}return!0}return typeof t==typeof e}let x=new Set;c.Proxy=new Proxy(v,{construct(t,e){let n=w(e[0]),o=C(e[0]),r=P(e[0]),u=String(n??"");if(n!==null&&r!==null&&u.length<500&&m.filter(l=>l.filter(i=>i.test(u)).length===l.length).length===1&&[...r.querySelectorAll("*")].filter(l=>{if(!(l instanceof HTMLElement))return!1;let i=l.getClientRects()[0]?.height??0,y=Math.max(a(getComputedStyle(l).getPropertyValue("padding-bottom")),a(getComputedStyle(l).getPropertyValue("margin-bottom")));return i>0&&y>=i*(b-p)&&y<=i*(S+p)}).length>=1)console.debug(`[${f}]: Prevented declaring render function in Vue.js 3 for detected PowerLink skeleton:`,e[0],r),x.add(n),z(e[0],()=>null),c.document.dispatchEvent(new CustomEvent("PL2PlaceHolderProxy"));else if(o!==null&&x.has(o))return console.debug(`[${f}]: Prevented declaring render function in Vue.js 3 in SPA moving for detected PowerLink skeleton:`,e[0]),H(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(...i){if(M(i[2])){console.debug(`[${f}]: Proxy set called for PowerLink Skeleton:`,i);return}if(k({Dummy:[],PowerLinkTracking:[{Url:"",UrlObj:{Url:""}}],LayoutFormat:"",NumberKey:[0,0,0],PowerLinkText:[{Url:"",Title:"",No:0}]},i[0])&&h(i[0])){console.debug(`[${f}]: Proxy set called for PowerLink Skeleton (target check):`,i),c.document.dispatchEvent(new CustomEvent("PL2PlaceHolderProxy"));return}else R(i[0],"")&&console.debug(`[${f}]: Proxy set called for PowerLink Skeleton (target check and replace):`,i);return d(l,this,i)}}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=>a(getComputedStyle(e).getPropertyValue("border-bottom-width"))>=.5)),t=new Set([...t].filter(e=>a(getComputedStyle(e).getPropertyValue("border-left-width"))>=.5)),t=new Set([...t].filter(e=>a(getComputedStyle(e).getPropertyValue("border-right-width"))>=.5)),t=new Set([...t].filter(e=>a(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=a(getComputedStyle(n).getPropertyValue("margin-bottom"));return o===0?!1:r>=o*.65&&r<=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=>a(getComputedStyle(e).getPropertyValue("margin-bottom"))>15||a(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&&a(getComputedStyle(n).getPropertyValue("padding-top"))>=5&&a(getComputedStyle(n).getPropertyValue("padding-bottom"))>=5&&a(getComputedStyle(n).getPropertyValue("padding-left"))>=5&&a(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=>a(getComputedStyle(e).getPropertyValue("padding-top"))>10||a(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=>a(getComputedStyle(e).getPropertyValue("border-bottom-width"))>=.5)),t=new Set([...t].filter(e=>a(getComputedStyle(e).getPropertyValue("border-left-width"))>=.5)),t=new Set([...t].filter(e=>a(getComputedStyle(e).getPropertyValue("border-right-width"))>=.5)),t=new Set([...t].filter(e=>a(getComputedStyle(e).getPropertyValue("border-top-width"))>=.5)),t=new Set([...t].filter(e=>a(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=>a(getComputedStyle(e).getPropertyValue("padding-top"))>=5&&a(getComputedStyle(e).getPropertyValue("padding-bottom"))>=5&&a(getComputedStyle(e).getPropertyValue("padding-left"))>=5&&a(getComputedStyle(e).getPropertyValue("padding-right"))>=5&&a(getComputedStyle(e).getPropertyValue("border-top-width"))>=.35&&a(getComputedStyle(e).getPropertyValue("border-bottom-width"))>=.35&&a(getComputedStyle(e).getPropertyValue("border-left-width"))>=.35&&a(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)})}T(Z);})();
|
|
24
|
+
(()=>{var Z=typeof unsafeWindow<"u"?unsafeWindow:window;function T(c,f="NamuLink"){let x=c.Function.prototype.call,d=c.Reflect.apply,v=c.Object.defineProperty,V=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 O(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 r=o.el;if(r instanceof HTMLElement)return r}n=n.parent}return null}function w(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 u=o.vnode;if(typeof u=="object"&&u!==null){let l=u.el;if(l instanceof HTMLElement)return l}}let r=n.vnode;if(typeof r=="object"&&r!==null){let u=r.el;if(u instanceof HTMLElement)return u}n=o}return null}let b=.35,S=.75,p=.04;function a(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 d(t,e,n);g=!0;let o=String(e);if(o.length<500&&m.filter(r=>r.filter(u=>u.test(o)).length===r.length).length===1){let r=P(n[6]);if(r!==null&&[...r.querySelectorAll("*")].filter(u=>{if(!(u instanceof HTMLElement))return!1;let l=u.getClientRects()[0]?.height??0,i=Math.max(a(getComputedStyle(u).getPropertyValue("padding-bottom")),a(getComputedStyle(u).getPropertyValue("margin-bottom")));return l>0&&i>=l*(b-p)&&i<=l*(S+p)}).length>=1)return console.debug(`[${f}]: Function.prototype.call called for PowerLink Skeleton:`,e),L=r,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(v,{apply(t,e,n){let o=w(n[0]),r=P(n[0]),u=String(o??"");if(o!==null&&r!==null&&u.length<500&&m.filter(l=>l.filter(i=>i.test(u)).length===l.length).length===1&&[...r.querySelectorAll("*")].filter(l=>{if(!(l instanceof HTMLElement))return!1;let i=l.getClientRects()[0]?.height??0,y=Math.max(a(getComputedStyle(l).getPropertyValue("padding-bottom")),a(getComputedStyle(l).getPropertyValue("margin-bottom")));return i>0&&y>=i*(b-p)&&y<=i*(S+p)}).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 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]+ *\) *\] *\(\) *;/]];c.setTimeout=new Proxy(c.setTimeout,{apply(t,e,n){let o=String(n[0]);return E.filter(r=>r.filter(u=>u.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 z(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 r=o;if(typeof r.render=="function")return r.render=e,0;o=r.parent}return 3}function C(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,r=o.render;if(typeof r=="function")return r;let u=o.vnode;if(typeof u=="object"&&u!==null){let l=u.type;if(typeof l=="object"&&l!==null){let i=l.render;if(typeof i=="function")return i}}n=o.parent}return null}function H(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 r=o,u=r.vnode;if(typeof u=="object"&&u!==null){let l=u.type;if(typeof l=="object"&&l!==null&&typeof l.render=="function")return l.render=e,0}o=r.parent}return 3}function M(t){return String(t).includes("https://ader.naver.com/")}function h(t,e=new WeakSet){if(e.has(t))return!1;e.add(t);for(let n of Object.keys(t)){let o=t[n],r=s(t,n);if(typeof o=="object"&&o!==null&&typeof r?.get!="function"){if(h(o,e))return!0}else if(typeof o=="string"&&o.includes("ader.naver.com"))return!0}return!1}function R(t,e){let n=t;for(let o of Object.keys(n)){let r=n[o],u=s(t,o);if(typeof r=="object"&&r!==null&&typeof u?.get!="function"){if(R(r,e))return!0}else if(typeof r=="string"&&r.includes("ader.naver.com"))return n[o]=e,!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 u of n){let l=!1;for(let i=0;i<o.length;i++)if(!r[i]&&k(u,o[i])){r[i]=!0,l=!0;break}if(!l)return!1}return!0}return typeof t==typeof e}let j=new Set;c.Proxy=new Proxy(V,{construct(t,e){let n=w(e[0]),o=C(e[0]),r=P(e[0]),u=String(n??"");if(n!==null&&r!==null&&u.length<500&&m.filter(l=>l.filter(i=>i.test(u)).length===l.length).length===1&&[...r.querySelectorAll("*")].filter(l=>{if(!(l instanceof HTMLElement))return!1;let i=l.getClientRects()[0]?.height??0,y=Math.max(a(getComputedStyle(l).getPropertyValue("padding-bottom")),a(getComputedStyle(l).getPropertyValue("margin-bottom")));return i>0&&y>=i*(b-p)&&y<=i*(S+p)}).length>=1)console.debug(`[${f}]: Prevented declaring render function in Vue.js 3 for detected PowerLink skeleton:`,e[0],r),j.add(n),z(e[0],()=>null),c.document.dispatchEvent(new CustomEvent("PL2PlaceHolderProxy"));else if(o!==null&&j.has(o))return console.debug(`[${f}]: Prevented declaring render function in Vue.js 3 in SPA moving for detected PowerLink skeleton:`,e[0]),H(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(...i){if(M(i[2])){console.debug(`[${f}]: Proxy set called for PowerLink Skeleton:`,i);return}if(h(i[0])&&k({Dummy:[],PowerLinkTracking:[{Url:"",UrlObj:{Url:""}}],LayoutFormat:"",NumberKey:[0,0,0],PowerLinkText:[{Url:"",Title:"",No:0}]},i[0])){console.debug(`[${f}]: Proxy set called for PowerLink Skeleton (target check):`,i),c.document.dispatchEvent(new CustomEvent("PL2PlaceHolderProxy"));return}else R(i[0],"")&&console.debug(`[${f}]: Proxy set called for PowerLink Skeleton (target check and replace):`,i);return d(l,this,i)}}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=>a(getComputedStyle(e).getPropertyValue("border-bottom-width"))>=.5)),t=new Set([...t].filter(e=>a(getComputedStyle(e).getPropertyValue("border-left-width"))>=.5)),t=new Set([...t].filter(e=>a(getComputedStyle(e).getPropertyValue("border-right-width"))>=.5)),t=new Set([...t].filter(e=>a(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=a(getComputedStyle(n).getPropertyValue("margin-bottom"));return o===0?!1:r>=o*.65&&r<=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=>a(getComputedStyle(e).getPropertyValue("margin-bottom"))>15||a(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&&a(getComputedStyle(n).getPropertyValue("padding-top"))>=5&&a(getComputedStyle(n).getPropertyValue("padding-bottom"))>=5&&a(getComputedStyle(n).getPropertyValue("padding-left"))>=5&&a(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=>a(getComputedStyle(e).getPropertyValue("padding-top"))>10||a(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=>a(getComputedStyle(e).getPropertyValue("border-bottom-width"))>=.5)),t=new Set([...t].filter(e=>a(getComputedStyle(e).getPropertyValue("border-left-width"))>=.5)),t=new Set([...t].filter(e=>a(getComputedStyle(e).getPropertyValue("border-right-width"))>=.5)),t=new Set([...t].filter(e=>a(getComputedStyle(e).getPropertyValue("border-top-width"))>=.5)),t=new Set([...t].filter(e=>a(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=>a(getComputedStyle(e).getPropertyValue("padding-top"))>=5&&a(getComputedStyle(e).getPropertyValue("padding-bottom"))>=5&&a(getComputedStyle(e).getPropertyValue("padding-left"))>=5&&a(getComputedStyle(e).getPropertyValue("padding-right"))>=5&&a(getComputedStyle(e).getPropertyValue("border-top-width"))>=.35&&a(getComputedStyle(e).getPropertyValue("border-bottom-width"))>=.35&&a(getComputedStyle(e).getPropertyValue("border-left-width"))>=.35&&a(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)})}T(Z);})();
|
|
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
|
@@ -253,14 +253,18 @@ export function RunNamuLinkUserscript(BrowserWindow, UserscriptName = 'NamuLink'
|
|
|
253
253
|
let Stringified = String(NewValue);
|
|
254
254
|
return Stringified.includes('https://ader.naver.com/');
|
|
255
255
|
}
|
|
256
|
-
function ProxySetHandlerTargetCheck(Target) {
|
|
256
|
+
function ProxySetHandlerTargetCheck(Target, Visited = new WeakSet()) {
|
|
257
|
+
if (Visited.has(Target)) {
|
|
258
|
+
return false;
|
|
259
|
+
}
|
|
260
|
+
Visited.add(Target);
|
|
257
261
|
for (const PropertyName of Object.keys(Target)) {
|
|
258
262
|
const Value = Target[PropertyName];
|
|
259
263
|
const Descriptor = OriginalObjectGetOwnPropertyDescriptor(Target, PropertyName);
|
|
260
264
|
if (typeof Value === 'object' &&
|
|
261
265
|
Value !== null &&
|
|
262
266
|
typeof Descriptor?.get !== 'function') {
|
|
263
|
-
if (ProxySetHandlerTargetCheck(Value)) {
|
|
267
|
+
if (ProxySetHandlerTargetCheck(Value, Visited)) {
|
|
264
268
|
return true;
|
|
265
269
|
}
|
|
266
270
|
}
|
|
@@ -363,7 +367,7 @@ export function RunNamuLinkUserscript(BrowserWindow, UserscriptName = 'NamuLink'
|
|
|
363
367
|
console.debug(`[${UserscriptName}]: Proxy set called for PowerLink Skeleton:`, SetArgs);
|
|
364
368
|
return;
|
|
365
369
|
}
|
|
366
|
-
if (MatchesShape({
|
|
370
|
+
if (ProxySetHandlerTargetCheck(SetArgs[0]) && MatchesShape({
|
|
367
371
|
Dummy: [],
|
|
368
372
|
PowerLinkTracking: [
|
|
369
373
|
{
|
|
@@ -382,7 +386,7 @@ export function RunNamuLinkUserscript(BrowserWindow, UserscriptName = 'NamuLink'
|
|
|
382
386
|
No: 0
|
|
383
387
|
}
|
|
384
388
|
]
|
|
385
|
-
}, SetArgs[0])
|
|
389
|
+
}, SetArgs[0])) {
|
|
386
390
|
console.debug(`[${UserscriptName}]: Proxy set called for PowerLink Skeleton (target check):`, SetArgs);
|
|
387
391
|
BrowserWindow.document.dispatchEvent(new CustomEvent('PL2PlaceHolderProxy'));
|
|
388
392
|
return;
|