@filteringdev/namulink 19.0.0-build.2 → 19.0.3

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,22 +8,21 @@
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.0-build.2
11
+ // @version 19.0.3
12
12
  // @author PiQuark6046 and contributors
13
13
  //
14
14
  // @grant unsafeWindow
15
15
  // @run-at document-start
16
16
  //
17
- // @description NamuLink allows AdGuard, uBlock Origin, Brave and ABP to resist against Ad-Shield quickly.
18
- // @description:ko NamuLink는 AdGuard, uBlock Origin, Brave 와 ABP가 애드쉴드에 빠르게 저항할 수 있도록 합니다.
19
- // @description:ja NamuLinkを使うと、AdGuard, uBlock Origin, Brave, およびABPがAd-Shieldに素早く対抗できます。
17
+ // @description NamuLink blocks the PowerLink advertisement on NamuWiki.
18
+ // @description:ko NamuLink는 나무위키에 있는 파워링크 광고를 차단합니다.
20
19
  //
21
20
  // @match *://namu.wiki/*
22
21
  // @match *://*.namu.wiki/*
23
22
  // ==/UserScript==
24
23
 
25
24
 
26
- (()=>{var s=typeof unsafeWindow<"u"?unsafeWindow:window;function m(n,r="NamuLink"){let u=n.Function.prototype.call,p=n.Reflect.apply,c=new CustomEvent("PL2PlaceHolder"),d=[[/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]+ *\(/]],g=[[/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]+ *\) *} *} *,/]],o=!1;n.Function.prototype.call=new Proxy(u,{apply(t,e,l){if(o)return p(t,e,l);o=!0;let i=String(e);return i.length<5e4&&!g.some(a=>a.every(f=>f.test(i)))&&d.filter(a=>a.filter(f=>f.test(i)).length===a.length).length===1?(console.debug(`[${r}]: Function.prototype.call called for PowerLink Skeleton:`,e),n.document.dispatchEvent(c),o=!1,p(t,()=>{},[])):(o=!1,p(t,e,l))}}),n.document.addEventListener("PL2PlaceHolder",()=>{setTimeout(()=>{let t=new Set([...n.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=>Number(getComputedStyle(e).getPropertyValue("padding-top").replaceAll(/px$/g,""))>20)),t=new Set([...t,...[...t].flatMap(e=>[...e.querySelectorAll("*")])]),t=new Set([...t].filter(e=>e instanceof HTMLElement&&e.innerText.trim().length===0)),t=new Set([...t].filter(e=>Number(getComputedStyle(e).getPropertyValue("border-bottom-width").replaceAll(/px/g,""))>=1)),t=new Set([...t].filter(e=>Number(getComputedStyle(e).getPropertyValue("border-left-width").replaceAll(/px/g,""))>=1)),t=new Set([...t].filter(e=>Number(getComputedStyle(e).getPropertyValue("border-right-width").replaceAll(/px/g,""))>=1)),t=new Set([...t].filter(e=>Number(getComputedStyle(e).getPropertyValue("border-top-width").replaceAll(/px/g,""))>=1)),console.debug(`[${r}]: Removing PowerLink Skeleton Containers:`,t),t.forEach(e=>{e.setAttribute("style","display: none !important;")})},2500),setTimeout(()=>{let t=new Set([...n.document.querySelectorAll('div[class*=" "] div[class*=" "] ~ div[class*=" "]')]);t=new Set([...t].filter(e=>e instanceof HTMLElement)),t=new Set([...t].filter(e=>Number(getComputedStyle(e).getPropertyValue("margin-bottom").replaceAll(/px$/g,""))>15||Number(getComputedStyle(e).getPropertyValue("padding-top").replaceAll(/px$/g,""))>20)),t=new Set([...t].filter(e=>e instanceof HTMLElement&&e.innerText.trim().length===0)),t=new Set([...t].filter(e=>[...e.querySelectorAll("*")].some(l=>l instanceof HTMLElement&&Number(getComputedStyle(l).getPropertyValue("padding-top").replaceAll(/px/g,""))>=5&&Number(getComputedStyle(l).getPropertyValue("padding-bottom").replaceAll(/px/g,""))>=5&&Number(getComputedStyle(l).getPropertyValue("padding-left").replaceAll(/px/g,""))>=5&&Number(getComputedStyle(l).getPropertyValue("padding-right").replaceAll(/px/g,""))>=5))),console.debug(`[${r}]: Removing PowerLink Skeleton Containers:`,t),t.forEach(e=>{e.setAttribute("style","display: none !important;")})},2500)})}m(s);})();
25
+ (()=>{var g=typeof unsafeWindow<"u"?unsafeWindow:window;function s(a,f="NamuLink"){let x=a.Function.prototype.call,r=a.Reflect.apply,u=new CustomEvent("PL2PlaceHolder"),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]+/]],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]+ *\) *} *} *,/]],n=!1;a.Function.prototype.call=new Proxy(x,{apply(t,e,l){if(n)return r(t,e,l);n=!0;let p=String(e);return p.length<5e4&&!d.some(o=>o.every(i=>i.test(p)))&&c.filter(o=>o.filter(i=>i.test(p)).length===o.length).length===1?(console.debug(`[${f}]: Function.prototype.call called for PowerLink Skeleton:`,e),a.document.dispatchEvent(u),n=!1,r(t,()=>{},[])):(n=!1,r(t,e,l))}}),a.document.addEventListener("PL2PlaceHolder",()=>{setTimeout(()=>{let t=new Set([...a.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=>Number(getComputedStyle(e).getPropertyValue("padding-top").replaceAll(/px$/g,""))>20)),t=new Set([...t,...[...t].flatMap(e=>[...e.querySelectorAll("*")])]),t=new Set([...t].filter(e=>e instanceof HTMLElement&&e.innerText.trim().length===0)),t=new Set([...t].filter(e=>Number(getComputedStyle(e).getPropertyValue("border-bottom-width").replaceAll(/px/g,""))>=1)),t=new Set([...t].filter(e=>Number(getComputedStyle(e).getPropertyValue("border-left-width").replaceAll(/px/g,""))>=1)),t=new Set([...t].filter(e=>Number(getComputedStyle(e).getPropertyValue("border-right-width").replaceAll(/px/g,""))>=1)),t=new Set([...t].filter(e=>Number(getComputedStyle(e).getPropertyValue("border-top-width").replaceAll(/px/g,""))>=1)),console.debug(`[${f}]: Removing PowerLink Skeleton Containers:`,t),t.forEach(e=>{e.setAttribute("style","display: none !important;")})},2500),setTimeout(()=>{let t=new Set([...a.document.querySelectorAll('div[class*=" "] div[class*=" "] ~ div[class*=" "]')]);t=new Set([...t].filter(e=>e instanceof HTMLElement)),t=new Set([...t].filter(e=>Number(getComputedStyle(e).getPropertyValue("margin-bottom").replaceAll(/px$/g,""))>15||Number(getComputedStyle(e).getPropertyValue("padding-top").replaceAll(/px$/g,""))>20)),t=new Set([...t].filter(e=>e instanceof HTMLElement&&e.innerText.trim().length===0)),t=new Set([...t].filter(e=>[...e.querySelectorAll("*")].some(l=>l instanceof HTMLElement&&Number(getComputedStyle(l).getPropertyValue("padding-top").replaceAll(/px/g,""))>=5&&Number(getComputedStyle(l).getPropertyValue("padding-bottom").replaceAll(/px/g,""))>=5&&Number(getComputedStyle(l).getPropertyValue("padding-left").replaceAll(/px/g,""))>=5&&Number(getComputedStyle(l).getPropertyValue("padding-right").replaceAll(/px/g,""))>=5))),console.debug(`[${f}]: Removing PowerLink Skeleton Containers:`,t),t.forEach(e=>{e.setAttribute("style","display: none !important;")})},2500)})}s(g);})();
27
26
  /*!
28
27
  * @license MPL-2.0
29
28
  * This Source Code Form is subject to the terms of the Mozilla Public
package/dist/index.js CHANGED
@@ -17,6 +17,11 @@ export function RunNamuLinkUserscript(BrowserWindow, UserscriptName = 'NamuLink'
17
17
  /('|")td('|") *, *{ *('|")class('|") *: *\( *-? *0x[a-f0-9]+ *\+ *-? *0x[a-f0-9]+ *\+ *0x[a-f0-9]+ *, *_0x[a-f0-9]+ *\[ *_0x[a-f0-9]+ */,
18
18
  /\( *_0x[a-f0-9]+ *\( *0x[a-f0-9]+ *\) *\) *, *('|")onClick('|") *: *_0x[a-f0-9]+ *\[ *-? *0x[a-f0-9]+ *\* *-? *0x[a-f0-9]+/,
19
19
  /_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]+ *\(/
20
+ ], [
21
+ /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]+/,
22
+ /\( *_0x[a-f0-9]+ *\( *0x[a-f0-9]+ *\) *\) *, *('|")onClick('|") *: *_0x[a-f0-9]+ *\[ *-? *0x[a-f0-9]+ *\* *-? *0x[a-f0-9]+/,
23
+ /_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
+ / *, *{ *('|")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]+/
20
25
  ]];
21
26
  const FalsePositiveSignPatterns = [[
22
27
  /new *Map *\( *Object *\[ *_0x[a-f0-9]+ *\( *0x[a-f0-9]+ *\) *\] *\( *{ *('|")pretendard('|") *: *{ *('|")fontFamily('|") *: */,
@@ -46,7 +51,7 @@ export function RunNamuLinkUserscript(BrowserWindow, UserscriptName = 'NamuLink'
46
51
  });
47
52
  BrowserWindow.document.addEventListener('PL2PlaceHolder', () => {
48
53
  setTimeout(() => {
49
- let ContainerElements = new Set([...BrowserWindow.document.querySelectorAll('div[class] div[class*=" "] div[class*=" "] ~ div[class*=" "]')]);
54
+ let ContainerElements = new Set([...BrowserWindow.document.querySelectorAll('div[class] div[class] div[class] ~ div[class]')]);
50
55
  ContainerElements = new Set([...ContainerElements].filter(Container => Container instanceof HTMLElement));
51
56
  ContainerElements = new Set([...ContainerElements].filter(Container => Number(getComputedStyle(Container).getPropertyValue('padding-top').replaceAll(/px$/g, '')) > 20));
52
57
  ContainerElements = new Set([...ContainerElements, ...[...ContainerElements].flatMap(Container => [...Container.querySelectorAll('*')])]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@filteringdev/namulink",
3
- "version": "19.0.0-build.2",
3
+ "version": "19.0.3",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "scripts": {