Skip to content

Commit 4bb9235

Browse files
committed
fix: refine element filtering logic based on viewport width
1 parent ba1badc commit 4bb9235

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

userscript/source/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ export async function RunNamuLinkUserscript(BrowserWindow: typeof window, Usersc
128128
return Children.length === 0
129129
})
130130
Targeted = Targeted.filter(Ele => {
131-
if (Ele.getBoundingClientRect().width < 500) return false
131+
if (Ele.getBoundingClientRect().width < 500 && BrowserWindow.document.body.getBoundingClientRect().width > 500) return false
132132
let Children = [...Ele.querySelectorAll('*[style]')].filter(Child => Child instanceof HTMLElement && Child.style.length > 0)
133133
return Children.filter(Child => {
134134
if (!(Child instanceof HTMLElement)) return false

0 commit comments

Comments
 (0)