From 6a14a480809e78c33034eac94b223b54dd35925a Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Mon, 26 Sep 2016 15:49:36 +0100 Subject: Use title attribute for link text. 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. --- content_scripts/link_hints.coffee | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'content_scripts') diff --git a/content_scripts/link_hints.coffee b/content_scripts/link_hints.coffee index 4bfd3ef2..c86eabf1 100644 --- a/content_scripts/link_hints.coffee +++ b/content_scripts/link_hints.coffee @@ -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} -- cgit v1.2.3