Skip to content

Commit

Permalink
Use title attribute for link text.
Browse files Browse the repository at this point in the history
Google seems to be using a lot of "title" attributes on buttons.  This
makes it possible to type the text in filtered link-hints mode.  (And
you can often guess the text; e.g. "close").

We could also show the title text.  That is very visually noisy though,
in practice.
  • Loading branch information
smblott-github committed Sep 26, 2016
1 parent afeb65f commit 6a14a48
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion content_scripts/link_hints.coffee
Expand Up @@ -858,8 +858,12 @@ LocalHints =
else if hint.reason?
linkText = hint.reason
showLinkText = true
else if 0 < element.textContent.length
linkText = element.textContent[...256]
else if element.hasAttribute "title"
linkText = element.getAttribute "title"
else
linkText = element.textContent[...256] || element.innerHTML[...256]
linkText = element.innerHTML[...256]

{linkText: linkText.trim(), showLinkText}

Expand Down

0 comments on commit 6a14a48

Please sign in to comment.