]> git.gir.st - VimFx.git/commit
Recognize more elements as clickable
authorSimon Lydell <simon.lydell@gmail.com>
Thu, 21 Jan 2016 06:47:18 +0000 (07:47 +0100)
committerSimon Lydell <simon.lydell@gmail.com>
Fri, 22 Jan 2016 16:14:23 +0000 (17:14 +0100)
commite3f8edef7875792c2037c9013a8e09f7892a66a4
treee7c303208190743b3d7496ce954b4d652f717824
parent59ce21abc3c75ca5da971a954fa1e7cc2690b240
Recognize more elements as clickable

- Elements with `data-` attributes used for clickable things by Bootstrap are
  now recognized. This is a huge win since Bootstrap is very popular and many
  developers use it with semantically unclickable elements (even though the
  Bootstrap documentation always reminds of accessibility concerns). Since these
  elements are or _should have been_ semantically clickable elements, they are
  always treated as such, in order not to give them too bad hints.

- A few `aria-` attributes are now recognized as semantically clickable.

- ARIA roles are now treated as _semantically_ clickable, instead of just
  clickable.

- "Close" buttons are now attempted to be recognized. This is useful for many of
  those obtrusive EU cookie law notices. Recognizing Bootstrap elements also
  helps greatly here.

- Finally, elements with 'click' event listeners (added using
  `element.addEventListener('click', ...)`) are now recognized, by using a
  Firefox API. This is really useful on DuckDuckGo's image search. Fixes #671
  and fixes #672.

  Note that event delegation is not supported, since that would require
  inspecting the code of the event listeners. One _could_ inspect the global
  `jQuery` object (if any) to get to solve that problem to a great extent (like
  Firefox's devtools do), but I'm not sure if that's a good idea.

It should also be noted that I tried recognizing elements matching
`/\bjs-/.test(element.className)`, but that proved give too many false
positives.
extension/lib/commands-frame.coffee
extension/lib/utils.coffee
Imprint / Impressum