aboutsummaryrefslogtreecommitdiffstats
path: root/content_scripts/link_hints.coffee
AgeCommit message (Collapse)Author
2015-04-29Use innerHTML instead of contentText.Stephen Blott
If we use contentText, then it is possible for a child and its to have exactly the same content text, in which case it is arbitrary as to which is sorted first, hence which we choose (where we should be choosing the child). Using innerHTML instead, we guess that even if the contentText lengths are the same, the innerHTML of the parent will be longer (since it contains that of the child).
2015-04-29Fix text matching/exclusion; repair tests.Stephen Blott
2015-04-29Fix text matching/exclusion for text link hints.Stephen Blott
We need to sort elements by their text length. This allows us to exclude the text of descendants from the hint text generated for their ancestors. Note: Tests not yet fixed.
2015-04-29Ignore keyboard repeats in link hint key handlermrmr1993
2015-04-28Make DomUtils.getVisibleClientRects default to expected behaviourmrmr1993
This requires passing of an extra truthy argument in order to access the (generally) unexpected behaviour of sometimes returning the rects of child elements. All locations in the code that *actually* wanted this behaviour have been updated to continue using it. Also add a comment about the unexpected behaviour in the function description.
2015-04-27Don't focus <input type="submit" /> elements from link hintsmrmr1993
2015-04-22Also filter for HREF in incognito mode.Stephen Blott
2015-04-22Filter out non-HREF elements for "yf".Stephen Blott
If the element does not have an HREF, then we shouldn't be offering to copy it's link.
2015-04-22For "yf", handle case where link.href isn't defined.Stephen Blott
Note: We probably shouldn't be offering these links at all.
2015-04-22Show yanked text in HUD for "yf".Stephen Blott
2015-04-18Mode indicator: more fix for link hints.Stephen Blott
2015-04-18Mode indicator: fix for link hints.Stephen Blott
2015-04-18Mode indicator: strip all references to badges.Stephen Blott
2015-03-09Pass keyup events after entering link-hint mode.Stephen Blott
The page (or another extension) sees keydown events (such as shift) before entering link-hint mode. So we need to also pass the corresponding keyup events. Fixes #1522.
2015-03-03Do not include duplicated texts in link hints.Stephen Blott
This only effects link hints with "Use the link's name and numbers for link-hint filtering" enabled. We have been matching the *entire text content* of each link-hint element. With two (or more) hints, and with one of the elements a descendent of the other, we have been using the entire text content of the outer node (which includes the text content of the inner node). This leads to odd situations where the inner element cannot be selected just by typing its text, because its text is a substring of the outer element's text. For example, on Google calendar, the "Today" button shows up as two hints, one inside the other. Typing "today" never disambiguates the hint. You always have to hit enter. There's another nasty example on feedly, where an outer container is clickable, but its text contains all of the (many) texts of the (many) contained links. So the hint always has to be selected manually. Here, when generating the text for an element, we exclude the texts from any descendent node which has already been considered.
2015-01-18Merge pull request #1413 from smblott-github/modesStephen Blott
A modal-browsing framework
2015-01-18Modes; pre-merge clean up.Stephen Blott
2015-01-17Minor rework in link hints.Stephen Blott
2015-01-17Rework modifier key handling for link hints.Stephen Blott
Mainly reduce code duplication.
2015-01-17Make `activateModeWithQueue` support link hint mode modifiersmrmr1993
2015-01-17Re-introduce ctrl, shift keys as link hint mode modifiersmrmr1993
This fixes #1096.
2015-01-15Modes; tweaks and fiddles.Stephen Blott
2015-01-14Modes; substantial reworking of insert mode (and friends).Stephen Blott
2015-01-13Modes; temporary commit.Stephen Blott
2015-01-13Modes; temporary commit.Stephen Blott
2015-01-12Modes; hint mode should be an insert-mode blocker...Stephen Blott
Also: - visual-mode template should block insert. - hint mode should exit on click.
2015-01-12Modes; (slightly) nicer badge.Stephen Blott
2015-01-11Modes; incorporate link hints.Stephen Blott
2014-12-30Update comment in getVisibleClickable.Stephen Blott
2014-12-30Minor changes to link-hint code.Stephen Blott
2014-12-29Return an array from getVisibleClickable, to restore img map supportmrmr1993
2014-12-29Move link hint clickable element detection to its own functionmrmr1993
2014-12-29Add a comment clarifying why we no longer use XPath for link hintsmrmr1993
2014-12-22Use a splat instead of applymrmr1993
2014-12-22Prefer `||=` to `= true if`mrmr1993
2014-12-22Use push with a splat rather than concatmrmr1993
2014-12-22Rename a poorly named variablemrmr1993
2014-12-20Use ||= to not ignore some clickable elements, no negative tabindexmrmr1993
Elements with `tabindex="n"` for parseInt(n) < 0 cannot be selected by pressing the tab key, according to the spec. If we have no other reason to suspect that the element is clickable, we may as well ignore them.
2014-12-19Detect aria properties for disabling/hiding elements in link hintsmrmr1993
2014-12-18Don't show a link hint for certain link hint elementsmrmr1993
Disables showing link hint for elements which * are identified as clickableonly by the tabindex attribute, and * have the entirety of their contents overlapped by other clickable elements. This removes some redundant link hints that were visible on Google+, and hopefully shouldn't remove any useful link hints.
2014-12-18Add brackets so the code compiles as expectedmrmr1993
2014-12-18Improve comments for LinkHints.getVisibleClickableElementsmrmr1993
2014-12-18Split textarea and input detection in link hintsmrmr1993
2014-12-18Move rect functions to their own filemrmr1993
2014-12-18Complete a partially written commentmrmr1993
2014-12-18Add link hint support for jsaction event listenersmrmr1993
This was adapted from PR #1316, commit 846a19efe51bfc639ae1ee84e18a5f2d3e12aaff
2014-12-18Remove overlapping rects from link hintsmrmr1993
2014-12-17Remove redundant array conversionmrmr1993
2014-12-17Combine rectangle calculation and clickable element detectionmrmr1993
2014-12-17Simplify finding clickable elementsmrmr1993