diff options
| author | Stephen Blott | 2015-04-22 12:24:54 +0100 |
|---|---|---|
| committer | Stephen Blott | 2015-04-22 12:24:54 +0100 |
| commit | caca2b6e81ba6fcad9cdc406c8cde15084db7539 (patch) | |
| tree | cd72ad145c864a6105f1ec70fd5df7fb76fa53a9 | |
| parent | 93e6a4dbac4512a7f1172c3b0c0284557ec80082 (diff) | |
| download | vimium-caca2b6e81ba6fcad9cdc406c8cde15084db7539.tar.bz2 | |
Filter out non-HREF elements for "yf".
If the element does not have an HREF, then we shouldn't be offering to
copy it's link.
| -rw-r--r-- | content_scripts/link_hints.coffee | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/content_scripts/link_hints.coffee b/content_scripts/link_hints.coffee index 5404d177..650080d4 100644 --- a/content_scripts/link_hints.coffee +++ b/content_scripts/link_hints.coffee @@ -56,7 +56,10 @@ LinkHints = return @isActive = true - hintMarkers = (@createMarkerFor(el) for el in @getVisibleClickableElements()) + elements = @getVisibleClickableElements() + # For COPY_LINK_URL mode, we filter out those elements which don't have an HREF to copy. + elements = (el for el in elements when el.element.href?) if mode == COPY_LINK_URL + hintMarkers = (@createMarkerFor(el) for el in elements) @getMarkerMatcher().fillInMarkers(hintMarkers) @hintMode = new Mode |
