File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -127,6 +127,20 @@ export async function RunNamuLinkUserscript(BrowserWindow: typeof window, Usersc
127127 Children = Children . filter ( Child => parseFloat ( getComputedStyle ( Child ) . getPropertyValue ( 'margin-left' ) ) >= 2.5 )
128128 return Children . length === 0
129129 } )
130+ Targeted = Targeted . filter ( Ele => {
131+ if ( Ele . getBoundingClientRect ( ) . width < 500 ) return false
132+ let Children = [ ...Ele . querySelectorAll ( '*[style]' ) ] . filter ( Child => Child instanceof HTMLElement && Child . style . length > 0 )
133+ return Children . filter ( Child => {
134+ if ( ! ( Child instanceof HTMLElement ) ) return false
135+ const ComputedStyle = getComputedStyle ( Child )
136+ const MissingCount = [ ...Child . style ] . filter ( Property => {
137+ const InlineValue = Child . style . getPropertyValue ( Property ) . trim ( )
138+ const ComputedValue = ComputedStyle . getPropertyValue ( Property ) . trim ( )
139+ return InlineValue !== ComputedValue
140+ } ) . length
141+ return MissingCount <= 1
142+ } ) . length < 5
143+ } )
130144 Targeted = await ExecuteOCR ( Targeted )
131145 Targeted . forEach ( Ele => Targeted . push ( ...new Set ( [ ...Ele . querySelectorAll ( '*' ) ] . filter ( Child => Child instanceof HTMLElement ) ) ) )
132146 Targeted = [ ...new Set ( Targeted ) ]
You can’t perform that action at this time.
0 commit comments