diff options
| author | mrmr1993 | 2017-11-02 12:27:55 +0000 |
|---|---|---|
| committer | mrmr1993 | 2017-11-02 12:27:55 +0000 |
| commit | 352ebd78194816d9b3be91724ac681e3a5f2f812 (patch) | |
| tree | d77026762cf6128dc0beb10f9ea6842d02daf53d | |
| parent | 15fc14dc40220af61f988c59378193cdb276a46f (diff) | |
| download | vimium-352ebd78194816d9b3be91724ac681e3a5f2f812.tar.bz2 | |
Add some roles used by GMail to link hints, reduce no. of comparisons
| -rw-r--r-- | content_scripts/link_hints.coffee | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/content_scripts/link_hints.coffee b/content_scripts/link_hints.coffee index ea256377..89cf29f1 100644 --- a/content_scripts/link_hints.coffee +++ b/content_scripts/link_hints.coffee @@ -658,9 +658,12 @@ LocalHints = 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" , "tab" , "link"] or - element.getAttribute("contentEditable")?.toLowerCase() in ["", "contentEditable", "true"]) + if element.hasAttribute("onclick") or + (role = element.getAttribute "role") and role.toLowerCase() in [ + "button" , "tab" , "link", "checkbox", "menuitem", "menuitemcheckbox", "menuitemradio" + ] or + (contentEditable = element.getAttribute "contentEditable") and + contentEditable.toLowerCase() in ["", "contentEditable", "true"] isClickable = true # Check for jsaction event listeners on the element. |
