From b95f7c1ed5ddbfafae1fc5197cd4d7cb99aaf1f8 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sat, 30 Jan 2016 15:47:04 +0000 Subject: Exit link hints if there are no links. If there are no links on a page, then link-hints mode should exit immediately. Fixes #1395. --- content_scripts/link_hints.coffee | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/content_scripts/link_hints.coffee b/content_scripts/link_hints.coffee index 07deaf61..60093bc7 100644 --- a/content_scripts/link_hints.coffee +++ b/content_scripts/link_hints.coffee @@ -58,6 +58,11 @@ class LinkHintsMode # ancestors. length = (el) -> el.element.innerHTML?.length ? 0 elements.sort (a,b) -> length(a) - length b + + if elements.length == 0 + HUD.showForDuration "No links to select.", 2000 + return + hintMarkers = (@createMarkerFor(el) for el in elements) @markerMatcher = new (if Settings.get "filterLinkHints" then FilterHints else AlphabetHints) @markerMatcher.fillInMarkers hintMarkers -- cgit v1.2.3