aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormrmr19932014-12-19 01:10:41 +0000
committermrmr19932014-12-19 01:11:36 +0000
commit1059f98d5c9a552b2fa3fbcdddc7e44d0676056e (patch)
tree1f0b3bca7122baad061fe1d3aa89dd701564aeda
parent4cfdc55b2054f3b00daf2aa2d8ffd482b4e3aaf9 (diff)
downloadvimium-1059f98d5c9a552b2fa3fbcdddc7e44d0676056e.tar.bz2
Detect aria properties for disabling/hiding elements in link hints
-rw-r--r--content_scripts/link_hints.coffee5
1 files changed, 5 insertions, 0 deletions
diff --git a/content_scripts/link_hints.coffee b/content_scripts/link_hints.coffee
index 6934e5b8..fa7fa937 100644
--- a/content_scripts/link_hints.coffee
+++ b/content_scripts/link_hints.coffee
@@ -152,6 +152,11 @@ LinkHints =
areaRects = DomUtils.getClientRectsForAreas imgClientRects[0], areas
visibleElements = visibleElements.concat areaRects
+ # Check aria properties to see if the element should be ignored.
+ if (element.getAttribute("aria-hidden")?.toLowerCase() in ["", "true"] or
+ element.getAttribute("aria-disabled")?.toLowerCase() in ["", "true"])
+ continue # No point continuing the loop; this element should never have a link hint
+
# Check for attributes that make an element clickable regardless of its tagName.
if (element.hasAttribute("onclick") or
element.getAttribute("role")?.toLowerCase() in ["button", "link"] or