diff options
| author | Stephen Blott | 2015-04-22 11:59:01 +0100 | 
|---|---|---|
| committer | Stephen Blott | 2015-04-22 11:59:01 +0100 | 
| commit | 93e6a4dbac4512a7f1172c3b0c0284557ec80082 (patch) | |
| tree | b0e5c9d34d75fced58efd4d7d42deb4e9a1a0463 /content_scripts | |
| parent | 3d273b68c34e5aeb9fd76d1979ee4606357a8631 (diff) | |
| download | vimium-93e6a4dbac4512a7f1172c3b0c0284557ec80082.tar.bz2 | |
For "yf", handle case where link.href isn't defined.
Note:  We probably shouldn't be offering these links at all.
Diffstat (limited to 'content_scripts')
| -rw-r--r-- | content_scripts/link_hints.coffee | 11 | 
1 files changed, 7 insertions, 4 deletions
| diff --git a/content_scripts/link_hints.coffee b/content_scripts/link_hints.coffee index 6bbe1f07..5404d177 100644 --- a/content_scripts/link_hints.coffee +++ b/content_scripts/link_hints.coffee @@ -95,10 +95,13 @@ LinkHints =      else if @mode is COPY_LINK_URL        @hintMode.setIndicator "Copy link URL to Clipboard"        @linkActivator = (link) => -        chrome.runtime.sendMessage handler: "copyToClipboard", data: link.href -        url = link.href -        url = url[0..25] + "...." if 28 < url.length -        @onExit = -> HUD.showForDuration "Yanked #{url}", 2000 +        if link.href? +          chrome.runtime.sendMessage handler: "copyToClipboard", data: link.href +          url = link.href +          url = url[0..25] + "...." if 28 < url.length +          @onExit = -> HUD.showForDuration "Yanked #{url}", 2000 +        else +          @onExit = -> HUD.showForDuration "No link to yank.", 2000      else if @mode is OPEN_INCOGNITO        @hintMode.setIndicator "Open link in incognito window"        @linkActivator = (link) -> | 
