Skip to content

Commit 4a84bcc

Browse files
committed
fix: category HTMLElement can be smaller than 100
1 parent 7de7521 commit 4a84bcc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sources/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export function RunNamuLinkUserscript(BrowserWindow: typeof window, UserscriptNa
102102
let Count = [...El.querySelectorAll('*')].filter(Child => (Child.getBoundingClientRect().bottom - Child.getBoundingClientRect().top > 25 && Child.getBoundingClientRect().right - Child.getBoundingClientRect().left > 25 && (Child instanceof SVGPathElement && Child.getAttribute('d') !== null) || (Child instanceof HTMLImageElement && Child.src.includes('//i.namu.wiki/i/')))).length
103103
return 1 <= Count && Count <= 6
104104
})
105-
TargetedAttrsDOMs = TargetedAttrsDOMs.filter(El => [...El.querySelectorAll('*')].some(Child => Child instanceof HTMLElement && getComputedStyle(Child, '::after').getPropertyValue('content').includes(':') && Child.getBoundingClientRect().right - Child.getBoundingClientRect().left > 100) === false)
105+
TargetedAttrsDOMs = TargetedAttrsDOMs.filter(El => [...El.querySelectorAll('*')].some(Child => Child instanceof HTMLElement && getComputedStyle(Child, '::after').getPropertyValue('content').includes(':') && Child.getBoundingClientRect().right - Child.getBoundingClientRect().left > 20) === false)
106106
console.debug(`[${UserscriptName}]`, TargetedAttrsDOMs)
107107
TargetedAttrsDOMs.forEach(El => {
108108
setInterval(() => {

0 commit comments

Comments
 (0)