mirror of
https://github.com/vale981/tridactyl
synced 2025-03-05 17:41:40 -05:00
commit
b4efcd1a8c
2 changed files with 5 additions and 1 deletions
|
@ -65,7 +65,8 @@ export function getMatches(findings, contextLength = 10): Match[] {
|
|||
!firstnode ||
|
||||
!lastnode ||
|
||||
isCommandLineNode(firstnode) ||
|
||||
isCommandLineNode(lastnode)
|
||||
isCommandLineNode(lastnode) ||
|
||||
!DOM.isVisible(firstnode)
|
||||
)
|
||||
continue
|
||||
|
||||
|
|
|
@ -217,6 +217,9 @@ export function widthMatters(style: CSSStyleDeclaration) {
|
|||
|
||||
*/
|
||||
export function isVisible(element: Element) {
|
||||
while (!(element.getClientRects instanceof Function)) {
|
||||
element = element.parentElement
|
||||
}
|
||||
const clientRect = element.getClientRects()[0]
|
||||
const computedStyle = getComputedStyle(element)
|
||||
// remove elements that are barely within the viewport, tiny, or invisible
|
||||
|
|
Loading…
Add table
Reference in a new issue