diff options
Diffstat (limited to 'content_scripts')
| -rw-r--r-- | content_scripts/link_hints.coffee | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/content_scripts/link_hints.coffee b/content_scripts/link_hints.coffee index 15af15c5..8e106b0f 100644 --- a/content_scripts/link_hints.coffee +++ b/content_scripts/link_hints.coffee @@ -167,6 +167,23 @@ class LinkHintsMode element.getAttribute("aria-disabled")?.toLowerCase() in ["", "true"]) return [] # This element should never have a link hint. + # Check for AngularJS listeners on the element. + @checkForAngularJs ?= do -> + angularElements = document.getElementsByClassName "ng-scope" + if angularElements.length == 0 + -> false + else + ngAttributes = [] + for prefix in [ '', 'data-', 'x-' ] + for separator in [ '-', ':', '_' ] + ngAttributes.push "#{prefix}ng#{separator}click" + (element) -> + for attribute in ngAttributes + return true if element.hasAttribute attribute + false + + isClickable ||= @checkForAngularJs element + # 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 |
