Skip to content

Commit 023d804

Browse files
committed
fix: 1st possible handling about obfuscation of NamuWiki's production building CI
1 parent a5709b9 commit 023d804

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

‎userscript/source/index.ts‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ export function RunNamuLinkUserscript(BrowserWindow: typeof window, UserscriptNa
2424
/('|")td('|") *, *{ *('|")class('|") *: *\( *-? *0x[a-f0-9]+ *\+ *-? *0x[a-f0-9]+ *\+ *0x[a-f0-9]+ *, *_0x[a-f0-9]+ *\[ *_0x[a-f0-9]+ */,
2525
/\( *_0x[a-f0-9]+ *\( *0x[a-f0-9]+ *\) *\) *, *('|")onClick('|") *: *_0x[a-f0-9]+ *\[ *-? *0x[a-f0-9]+ *\* *-? *0x[a-f0-9]+/,
2626
/_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]+ *\(/
27+
], [
28+
/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]+/,
29+
/\( *_0x[a-f0-9]+ *\( *0x[a-f0-9]+ *\) *\) *, *('|")onClick('|") *: *_0x[a-f0-9]+ *\[ *-? *0x[a-f0-9]+ *\* *-? *0x[a-f0-9]+/,
30+
/_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]+/,
31+
/ *, *{ *('|")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]+/
2732
]]
2833
const FalsePositiveSignPatterns: RegExp[][] = [[
2934
/new *Map *\( *Object *\[ *_0x[a-f0-9]+ *\( *0x[a-f0-9]+ *\) *\] *\( *{ *('|")pretendard('|") *: *{ *('|")fontFamily('|") *: */,
@@ -48,16 +53,15 @@ export function RunNamuLinkUserscript(BrowserWindow: typeof window, UserscriptNa
4853
BrowserWindow.document.dispatchEvent(PL2Event)
4954
InHook = false
5055
return OriginalReflectApply(Target, () => {}, [])
51-
}
52-
56+
}
5357
InHook = false
5458
return OriginalReflectApply(Target, ThisArg, Args)
5559
}
5660
})
5761

5862
BrowserWindow.document.addEventListener('PL2PlaceHolder', () => {
5963
setTimeout(() => {
60-
let ContainerElements = new Set([...BrowserWindow.document.querySelectorAll('div[class] div[class*=" "] div[class*=" "] ~ div[class*=" "]')])
64+
let ContainerElements = new Set([...BrowserWindow.document.querySelectorAll('div[class] div[class] div[class] ~ div[class]')])
6165
ContainerElements = new Set([...ContainerElements].filter(Container => Container instanceof HTMLElement))
6266
ContainerElements = new Set([...ContainerElements].filter(Container => Number(getComputedStyle(Container).getPropertyValue('padding-top').replaceAll(/px$/g, '')) > 20))
6367
ContainerElements = new Set([...ContainerElements, ...[...ContainerElements].flatMap(Container => [...Container.querySelectorAll('*')])])

0 commit comments

Comments
 (0)