@filteringdev/namulink 19.0.6-build.3 → 19.1.0-build.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.
- package/dist/NamuLink.user.js +2 -2
- package/dist/index.js +44 -12
- 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.0
|
|
11
|
+
// @version 19.1.0-build.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
|
|
25
|
+
(()=>{var m=typeof unsafeWindow<"u"?unsafeWindow:window;function g(l,f="NamuLink"){let u=l.Function.prototype.call,r=l.Reflect.apply,c=[[/function *\( *_0x[a-f0-9]+ *, *_0x[a-f0-9]+ *, *_0x[a-f0-9]+ *, *_0x[a-f0-9]+ *, *_0x[a-f0-9]+ *, *_0x[a-f0-9]+ *\) *{ *var *_0x[a-f0-9]+/,/('|")td('|") *, *{ *('|")class('|") *: *\( *-? *0x[a-f0-9]+ *\+ *-? *0x[a-f0-9]+ *\+ *0x[a-f0-9]+ *, *_0x[a-f0-9]+ *\[ *_0x[a-f0-9]+ */,/\( *_0x[a-f0-9]+ *\( *0x[a-f0-9]+ *\) *\) *, *('|")onClick('|") *: *_0x[a-f0-9]+ *\[ *-? *0x[a-f0-9]+ *\* *-? *0x[a-f0-9]+/,/_0x[a-f0-9]+ *\( *0x[a-f0-9]+ *\) *\) *, *('|")colspan('|") *: *_0x[a-f0-9]+ *\( *0x[a-f0-9]+ *\) *=== *_0x[a-f0-9]+ *\[ *_0x[a-f0-9]+ *\(/],[/function *\( *_0x[a-f0-9]+ *, *_0x[a-f0-9]+ *, *_0x[a-f0-9]+ *, *_0x[a-f0-9]+ *, *_0x[a-f0-9]+ *, *_0x[a-f0-9]+ *\) *{ *var *_0x[a-f0-9]+/,/\( *_0x[a-f0-9]+ *\( *0x[a-f0-9]+ *\) *\) *, *('|")onClick('|") *: *_0x[a-f0-9]+ *\[ *-? *0x[a-f0-9]+ *\* *-? *0x[a-f0-9]+/,/_0x[a-f0-9]+ *\( *0x[a-f0-9]+ *\) *\] *\) *\( *_0x[a-f0-9]+ *=> *_0x[a-f0-9]+ *\[ *_0x[a-f0-9]+ *\( *0x[a-f0-9]+ *\) *\] *\( *_0x[a-f0-9]+/,/ *, *{ *('|")class('|") *: *\( *-? *0x[a-f0-9,_+*x-]+ *\[ *_0x[a-f0-9]+ *\( *0x[a-f0-9]+ *\) *\] *\) *\( *_0x[a-f0-9]+ *\( *0x[a-f0-9]+ *\) *\) *} *, *\[ *! *_0x[a-f0-9]+/],[/function *\( *_0x[a-f0-9]+ *, *_0x[a-f0-9]+ *, *_0x[a-f0-9]+ *, *_0x[a-f0-9]+ *, *_0x[a-f0-9]+ *, *_0x[a-f0-9]+ *\) *{ *var *_0x[a-f0-9]+/,/\( *_0x[a-f0-9]+ *\( *0x[a-f0-9]+ *\) *\) *, *('|")onClick('|") *: *_0x[a-f0-9]+ *\[ *-? *0x[a-f0-9]+ *\* *-? *0x[a-f0-9]+/,/_0x[a-f0-9]+ *\( *0x[a-f0-9]+ *\) *\] *\) *\( *_0x[a-f0-9]+ *=> *_0x[a-f0-9]+ *\[ *_0x[a-f0-9]+ *\( *0x[a-f0-9]+ *\) *\] *\( *_0x[a-f0-9]+/,/_0x[a-f0-9]+ *\[ *['"a-zA-Z0-9_-]+ *\] *\) *\( *_0x[a-f0-9]+ *\( *0x[a-f0-9]+ *\) *, *null *,\[ *Array *\[ *_0x[a-f0-9]+ *\( *0x[a-f0-9]+ *\) *\]/],[/function *\( *_0x[a-f0-9]+ *, *_0x[a-f0-9]+ *, *_0x[a-f0-9]+ *, *_0x[a-f0-9]+ *, *_0x[a-f0-9]+ *, *_0x[a-f0-9]+ *\) *{ *var *_0x[a-f0-9]+/,/_0x[a-f0-9]+ *\( *0x[a-f0-9]+ *\) *\] *\) *\( *_0x[a-f0-9]+ *=> *_0x[a-f0-9]+ *\[ *_0x[a-f0-9]+ *\( *0x[a-f0-9]+ *\) *\] *\( *_0x[a-f0-9]+/,/('|")onClick('|") *: *\( *-? *[x0-9a-f+-]+ *, *_0x[0-9a-f]+ *\[ *_0x[0-9a-f]+ *\( *0x[0-9a-f]+ *\) *\] *\) *\( *\( *\) *=> *_0x[0-9a-f]+/,/('|")colspan('|") *: *('|")[0-9]+('|") *, *('|")class('|") *: *\( *-? *[xa-f0-9*+-]+ *, *_0x[a-f0-9]+ *\[ *_0x[a-f0-9]+ *\( *0x[a-f0-9]+ *\) *\] *\) *\( *\[ *_0x[a-f0-9]+ *\( *0x[a-f0-9]+ *\) *,/]],d=[[/new *Map *\( *Object *\[ *_0x[a-f0-9]+ *\( *0x[a-f0-9]+ *\) *\] *\( *{ *('|")pretendard('|") *: *{ *('|")fontFamily('|") *: */,/('|")fontFamily('|") *: *_0x[a-f0-9]+ *\( *0x[a-f0-9]+ *\) *, *('|")styleUrl('|") *: *_0x[a-f0-9]+ *\( *0x[a-f0-9]+ *\) *, *('|")isGoogleFonts/,/('|")popper--wide('|") *: *_0x[a-f0-9]+ *\( *0x[a-f0-9]+ *\) *, *('|")popper__title('|") *: *_0x[a-f0-9]+ *\( *0x[a-f0-9]+ *\) *} *} *,/]],p=null,i=!1;l.Function.prototype.call=new Proxy(u,{apply(e,t,a){if(i)return r(e,t,a);i=!0;let n=String(t);return n.length<5e4&&!d.some(o=>o.every(x=>x.test(n)))&&c.filter(o=>o.filter(x=>x.test(n)).length===o.length).length===1?(console.debug(`[${f}]: Function.prototype.call called for PowerLink Skeleton:`,t),typeof a[6]=="object"&&typeof a[6]._=="object"&&typeof a[6]._.vnode=="object"&&a[6]._.vnode!==null&&typeof a[6]._.vnode.el=="object"&&a[6]._.vnode.el instanceof HTMLElement&&(p=a[6]._.vnode.el),l.document.dispatchEvent(new CustomEvent("PL2PlaceHolder")),l.document.dispatchEvent(new CustomEvent("PL2PlaceHolderMobile")),i=!1,r(e,()=>{},[])):(i=!1,r(e,t,a))}});let _=[[/\( *\) *=> *{ *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]+ *\) *\] *\(\) *;/]];l.setTimeout=new Proxy(l.setTimeout,{apply(e,t,a){let n=String(a[0]);return _.filter(o=>o.filter(x=>x.test(n)).length>=1).length===1?(console.debug(`[${f}]: setTimeout called for PowerLink Skeleton:`,a[0]),r(e,t,[()=>{},0])):r(e,t,a)}}),l.document.addEventListener("PL2AdvertContainer",()=>{setTimeout(()=>{let e=new Set([p]);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(a=>{if(!(a instanceof HTMLElement))return!1;let n=a.getClientRects()[0]?.height??0,o=Number(getComputedStyle(a).getPropertyValue("margin-bottom").replaceAll(/px/g,""));return n===0?!1:o>=n*.65&&o<=n*1.25}))),console.debug(`[${f}]: Removing PowerLink Skeleton Containers (PL2AdvertContainer):`,e),e.forEach(t=>{t.setAttribute("style","display: none !important;")})},2500)}),l.document.addEventListener("PL2PlaceHolderMobile",()=>{setTimeout(()=>{let e=new Set([...l.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(a=>a instanceof HTMLElement&&Number(getComputedStyle(a).getPropertyValue("padding-top").replaceAll(/px/g,""))>=5&&Number(getComputedStyle(a).getPropertyValue("padding-bottom").replaceAll(/px/g,""))>=5&&Number(getComputedStyle(a).getPropertyValue("padding-left").replaceAll(/px/g,""))>=5&&Number(getComputedStyle(a).getPropertyValue("padding-right").replaceAll(/px/g,""))>=5))),console.debug(`[${f}]: Removing PowerLink Skeleton Containers (PL2PlaceHolderMobile):`,e),e.forEach(t=>{t.setAttribute("style","display: none !important;")})},2500),l.document.addEventListener("PL2PlaceHolder",()=>{setTimeout(()=>{let e=new Set([...l.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(`[${f}]: Removing PowerLink Skeleton Containers (PL2PlaceHolder):`,e),e.forEach(t=>{t.setAttribute("style","display: none !important;")})},2500)})})}g(m);})();
|
|
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
|
@@ -11,7 +11,6 @@ const Win = typeof unsafeWindow !== 'undefined' ? unsafeWindow : window;
|
|
|
11
11
|
export function RunNamuLinkUserscript(BrowserWindow, UserscriptName = 'NamuLink') {
|
|
12
12
|
const OriginalFunctionPrototypeCall = BrowserWindow.Function.prototype.call;
|
|
13
13
|
const OriginalReflectApply = BrowserWindow.Reflect.apply;
|
|
14
|
-
let PL2Event = new CustomEvent('PL2PlaceHolder');
|
|
15
14
|
const PL2MajorFuncCallPatterns = [[
|
|
16
15
|
/function *\( *_0x[a-f0-9]+ *, *_0x[a-f0-9]+ *, *_0x[a-f0-9]+ *, *_0x[a-f0-9]+ *, *_0x[a-f0-9]+ *, *_0x[a-f0-9]+ *\) *{ *var *_0x[a-f0-9]+/,
|
|
17
16
|
/('|")td('|") *, *{ *('|")class('|") *: *\( *-? *0x[a-f0-9]+ *\+ *-? *0x[a-f0-9]+ *\+ *0x[a-f0-9]+ *, *_0x[a-f0-9]+ *\[ *_0x[a-f0-9]+ */,
|
|
@@ -22,12 +21,23 @@ export function RunNamuLinkUserscript(BrowserWindow, UserscriptName = 'NamuLink'
|
|
|
22
21
|
/\( *_0x[a-f0-9]+ *\( *0x[a-f0-9]+ *\) *\) *, *('|")onClick('|") *: *_0x[a-f0-9]+ *\[ *-? *0x[a-f0-9]+ *\* *-? *0x[a-f0-9]+/,
|
|
23
22
|
/_0x[a-f0-9]+ *\( *0x[a-f0-9]+ *\) *\] *\) *\( *_0x[a-f0-9]+ *=> *_0x[a-f0-9]+ *\[ *_0x[a-f0-9]+ *\( *0x[a-f0-9]+ *\) *\] *\( *_0x[a-f0-9]+/,
|
|
24
23
|
/ *, *{ *('|")class('|") *: *\( *-? *0x[a-f0-9,_+*x-]+ *\[ *_0x[a-f0-9]+ *\( *0x[a-f0-9]+ *\) *\] *\) *\( *_0x[a-f0-9]+ *\( *0x[a-f0-9]+ *\) *\) *} *, *\[ *! *_0x[a-f0-9]+/
|
|
24
|
+
], [
|
|
25
|
+
/function *\( *_0x[a-f0-9]+ *, *_0x[a-f0-9]+ *, *_0x[a-f0-9]+ *, *_0x[a-f0-9]+ *, *_0x[a-f0-9]+ *, *_0x[a-f0-9]+ *\) *{ *var *_0x[a-f0-9]+/,
|
|
26
|
+
/\( *_0x[a-f0-9]+ *\( *0x[a-f0-9]+ *\) *\) *, *('|")onClick('|") *: *_0x[a-f0-9]+ *\[ *-? *0x[a-f0-9]+ *\* *-? *0x[a-f0-9]+/,
|
|
27
|
+
/_0x[a-f0-9]+ *\( *0x[a-f0-9]+ *\) *\] *\) *\( *_0x[a-f0-9]+ *=> *_0x[a-f0-9]+ *\[ *_0x[a-f0-9]+ *\( *0x[a-f0-9]+ *\) *\] *\( *_0x[a-f0-9]+/,
|
|
28
|
+
/_0x[a-f0-9]+ *\[ *['"a-zA-Z0-9_-]+ *\] *\) *\( *_0x[a-f0-9]+ *\( *0x[a-f0-9]+ *\) *, *null *,\[ *Array *\[ *_0x[a-f0-9]+ *\( *0x[a-f0-9]+ *\) *\]/
|
|
29
|
+
], [
|
|
30
|
+
/function *\( *_0x[a-f0-9]+ *, *_0x[a-f0-9]+ *, *_0x[a-f0-9]+ *, *_0x[a-f0-9]+ *, *_0x[a-f0-9]+ *, *_0x[a-f0-9]+ *\) *{ *var *_0x[a-f0-9]+/,
|
|
31
|
+
/_0x[a-f0-9]+ *\( *0x[a-f0-9]+ *\) *\] *\) *\( *_0x[a-f0-9]+ *=> *_0x[a-f0-9]+ *\[ *_0x[a-f0-9]+ *\( *0x[a-f0-9]+ *\) *\] *\( *_0x[a-f0-9]+/,
|
|
32
|
+
/('|")onClick('|") *: *\( *-? *[x0-9a-f+-]+ *, *_0x[0-9a-f]+ *\[ *_0x[0-9a-f]+ *\( *0x[0-9a-f]+ *\) *\] *\) *\( *\( *\) *=> *_0x[0-9a-f]+/,
|
|
33
|
+
/('|")colspan('|") *: *('|")[0-9]+('|") *, *('|")class('|") *: *\( *-? *[xa-f0-9*+-]+ *, *_0x[a-f0-9]+ *\[ *_0x[a-f0-9]+ *\( *0x[a-f0-9]+ *\) *\] *\) *\( *\[ *_0x[a-f0-9]+ *\( *0x[a-f0-9]+ *\) *,/
|
|
25
34
|
]];
|
|
26
35
|
const FalsePositiveSignPatterns = [[
|
|
27
36
|
/new *Map *\( *Object *\[ *_0x[a-f0-9]+ *\( *0x[a-f0-9]+ *\) *\] *\( *{ *('|")pretendard('|") *: *{ *('|")fontFamily('|") *: */,
|
|
28
37
|
/('|")fontFamily('|") *: *_0x[a-f0-9]+ *\( *0x[a-f0-9]+ *\) *, *('|")styleUrl('|") *: *_0x[a-f0-9]+ *\( *0x[a-f0-9]+ *\) *, *('|")isGoogleFonts/,
|
|
29
38
|
/('|")popper--wide('|") *: *_0x[a-f0-9]+ *\( *0x[a-f0-9]+ *\) *, *('|")popper__title('|") *: *_0x[a-f0-9]+ *\( *0x[a-f0-9]+ *\) *} *} *,/
|
|
30
39
|
]];
|
|
40
|
+
let CommentContainer = null;
|
|
31
41
|
let InHook = false;
|
|
32
42
|
BrowserWindow.Function.prototype.call = new Proxy(OriginalFunctionPrototypeCall, {
|
|
33
43
|
apply(Target, ThisArg, Args) {
|
|
@@ -41,7 +51,12 @@ export function RunNamuLinkUserscript(BrowserWindow, UserscriptName = 'NamuLink'
|
|
|
41
51
|
!FalsePositiveSignPatterns.some(Patterns => Patterns.every(Pattern => Pattern.test(Stringified))) &&
|
|
42
52
|
PL2MajorFuncCallPatterns.filter(Patterns => Patterns.filter(Pattern => Pattern.test(Stringified)).length === Patterns.length).length === 1) {
|
|
43
53
|
console.debug(`[${UserscriptName}]: Function.prototype.call called for PowerLink Skeleton:`, ThisArg);
|
|
44
|
-
|
|
54
|
+
if (typeof Args[6] === 'object' && typeof Args[6]['_'] === 'object' && typeof Args[6]['_']['vnode'] === 'object' &&
|
|
55
|
+
Args[6]['_']['vnode'] !== null && typeof Args[6]['_']['vnode']['el'] === 'object' && Args[6]['_']['vnode']['el'] instanceof HTMLElement) {
|
|
56
|
+
CommentContainer = Args[6]['_']['vnode']['el'];
|
|
57
|
+
}
|
|
58
|
+
BrowserWindow.document.dispatchEvent(new CustomEvent('PL2PlaceHolder'));
|
|
59
|
+
BrowserWindow.document.dispatchEvent(new CustomEvent('PL2PlaceHolderMobile'));
|
|
45
60
|
InHook = false;
|
|
46
61
|
return OriginalReflectApply(Target, () => { }, []);
|
|
47
62
|
}
|
|
@@ -66,16 +81,10 @@ export function RunNamuLinkUserscript(BrowserWindow, UserscriptName = 'NamuLink'
|
|
|
66
81
|
return OriginalReflectApply(Target, ThisArg, Args);
|
|
67
82
|
}
|
|
68
83
|
});
|
|
69
|
-
BrowserWindow.document.addEventListener('
|
|
84
|
+
BrowserWindow.document.addEventListener('PL2AdvertContainer', () => {
|
|
70
85
|
setTimeout(() => {
|
|
71
|
-
let ContainerElements = new Set([
|
|
72
|
-
ContainerElements = new Set([...ContainerElements].filter(Container => Container instanceof HTMLElement));
|
|
73
|
-
ContainerElements = new Set([...ContainerElements].filter(Container => {
|
|
74
|
-
return Number(getComputedStyle(Container).getPropertyValue('padding-top').replaceAll(/px$/g, '')) > 10 ||
|
|
75
|
-
Number(getComputedStyle(Container).getPropertyValue('margin-top').replaceAll(/px$/g, '')) > 10;
|
|
76
|
-
}));
|
|
86
|
+
let ContainerElements = new Set([CommentContainer]);
|
|
77
87
|
ContainerElements = new Set([...ContainerElements, ...[...ContainerElements].flatMap(Container => [...Container.querySelectorAll('*')])]);
|
|
78
|
-
ContainerElements = new Set([...ContainerElements].filter(Container => Container instanceof HTMLElement && Container.innerText.trim().length === 0));
|
|
79
88
|
ContainerElements = new Set([...ContainerElements].filter(Container => Number(getComputedStyle(Container).getPropertyValue('border-bottom-width').replaceAll(/px/g, '')) >= 0.5));
|
|
80
89
|
ContainerElements = new Set([...ContainerElements].filter(Container => Number(getComputedStyle(Container).getPropertyValue('border-left-width').replaceAll(/px/g, '')) >= 0.5));
|
|
81
90
|
ContainerElements = new Set([...ContainerElements].filter(Container => Number(getComputedStyle(Container).getPropertyValue('border-right-width').replaceAll(/px/g, '')) >= 0.5));
|
|
@@ -89,11 +98,13 @@ export function RunNamuLinkUserscript(BrowserWindow, UserscriptName = 'NamuLink'
|
|
|
89
98
|
return false;
|
|
90
99
|
return PL2TitleMarginBottom >= PL2TitleHeight * 0.65 && PL2TitleMarginBottom <= PL2TitleHeight * 1.25;
|
|
91
100
|
})));
|
|
92
|
-
console.debug(`[${UserscriptName}]: Removing PowerLink Skeleton Containers:`, ContainerElements);
|
|
101
|
+
console.debug(`[${UserscriptName}]: Removing PowerLink Skeleton Containers (PL2AdvertContainer):`, ContainerElements);
|
|
93
102
|
ContainerElements.forEach(Container => {
|
|
94
103
|
Container.setAttribute('style', 'display: none !important;');
|
|
95
104
|
});
|
|
96
105
|
}, 2500);
|
|
106
|
+
});
|
|
107
|
+
BrowserWindow.document.addEventListener('PL2PlaceHolderMobile', () => {
|
|
97
108
|
setTimeout(() => {
|
|
98
109
|
let ContainerElements = new Set([...BrowserWindow.document.querySelectorAll('div[class] div[class] div[class] ~ div[class]')]);
|
|
99
110
|
ContainerElements = new Set([...ContainerElements].filter(Container => Container instanceof HTMLElement));
|
|
@@ -105,11 +116,32 @@ export function RunNamuLinkUserscript(BrowserWindow, UserscriptName = 'NamuLink'
|
|
|
105
116
|
Number(getComputedStyle(Child).getPropertyValue('padding-bottom').replaceAll(/px/g, '')) >= 5 &&
|
|
106
117
|
Number(getComputedStyle(Child).getPropertyValue('padding-left').replaceAll(/px/g, '')) >= 5 &&
|
|
107
118
|
Number(getComputedStyle(Child).getPropertyValue('padding-right').replaceAll(/px/g, '')) >= 5))));
|
|
108
|
-
console.debug(`[${UserscriptName}]: Removing PowerLink Skeleton Containers:`, ContainerElements);
|
|
119
|
+
console.debug(`[${UserscriptName}]: Removing PowerLink Skeleton Containers (PL2PlaceHolderMobile):`, ContainerElements);
|
|
109
120
|
ContainerElements.forEach(Container => {
|
|
110
121
|
Container.setAttribute('style', 'display: none !important;');
|
|
111
122
|
});
|
|
112
123
|
}, 2500);
|
|
124
|
+
BrowserWindow.document.addEventListener('PL2PlaceHolder', () => {
|
|
125
|
+
setTimeout(() => {
|
|
126
|
+
let ContainerElements = new Set([...BrowserWindow.document.querySelectorAll('div[class] div[class] div[class] ~ div[class]')]);
|
|
127
|
+
ContainerElements = new Set([...ContainerElements].filter(Container => Container instanceof HTMLElement));
|
|
128
|
+
ContainerElements = new Set([...ContainerElements].filter(Container => {
|
|
129
|
+
return Number(getComputedStyle(Container).getPropertyValue('padding-top').replaceAll(/px$/g, '')) > 10 ||
|
|
130
|
+
Number(getComputedStyle(Container).getPropertyValue('margin-top').replaceAll(/px$/g, '')) > 10;
|
|
131
|
+
}));
|
|
132
|
+
ContainerElements = new Set([...ContainerElements, ...[...ContainerElements].flatMap(Container => [...Container.querySelectorAll('*:not(button)')])]);
|
|
133
|
+
ContainerElements = new Set([...ContainerElements].filter(Container => Container instanceof HTMLElement && Container.innerText.trim().length === 0));
|
|
134
|
+
ContainerElements = new Set([...ContainerElements].filter(Container => Number(getComputedStyle(Container).getPropertyValue('border-bottom-width').replaceAll(/px/g, '')) >= 0.5));
|
|
135
|
+
ContainerElements = new Set([...ContainerElements].filter(Container => Number(getComputedStyle(Container).getPropertyValue('border-left-width').replaceAll(/px/g, '')) >= 0.5));
|
|
136
|
+
ContainerElements = new Set([...ContainerElements].filter(Container => Number(getComputedStyle(Container).getPropertyValue('border-right-width').replaceAll(/px/g, '')) >= 0.5));
|
|
137
|
+
ContainerElements = new Set([...ContainerElements].filter(Container => Number(getComputedStyle(Container).getPropertyValue('border-top-width').replaceAll(/px/g, '')) >= 0.5));
|
|
138
|
+
ContainerElements = new Set([...ContainerElements].filter(Container => Number(getComputedStyle(Container).getPropertyValue('transition-duration').replaceAll(/s$/g, '')) >= 0.01));
|
|
139
|
+
console.debug(`[${UserscriptName}]: Removing PowerLink Skeleton Containers (PL2PlaceHolder):`, ContainerElements);
|
|
140
|
+
ContainerElements.forEach(Container => {
|
|
141
|
+
Container.setAttribute('style', 'display: none !important;');
|
|
142
|
+
});
|
|
143
|
+
}, 2500);
|
|
144
|
+
});
|
|
113
145
|
});
|
|
114
146
|
}
|
|
115
147
|
RunNamuLinkUserscript(Win);
|