Skip to content

Commit 15eb343

Browse files
committed
fix: powerlink advert is not hidden
13153d3
1 parent 2a7e4f2 commit 15eb343

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

userscript/source/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,10 @@ export async function RunNamuLinkUserscript(BrowserWindow: typeof window, Usersc
118118
})
119119
})
120120
Targeted = Targeted.filter(Ele => {
121-
let Rect = Ele.getBoundingClientRect()
122-
return Rect.width / Rect.height <= 1
121+
let Children = [...Ele.querySelectorAll('*')].filter(Child => Child instanceof HTMLElement)
122+
Children = Children.filter(Child => parseFloat(getComputedStyle(Child).getPropertyValue('padding-right')) >= 10 && parseFloat(getComputedStyle(Child).getPropertyValue('padding-bottom')) >= 10)
123+
Children = Children.filter(Child => parseFloat(getComputedStyle(Child).getPropertyValue('margin-left')) >= 2.5)
124+
return Children.length === 0
123125
})
124126
Targeted = await ExecuteOCR(Targeted)
125127
Targeted.forEach(Ele => Targeted.push(...new Set([...Ele.querySelectorAll('*')].filter(Child => Child instanceof HTMLElement))))

0 commit comments

Comments
 (0)