diff options
| author | mrmr1993 | 2017-09-29 17:45:06 +0100 | 
|---|---|---|
| committer | mrmr1993 | 2017-09-29 17:45:06 +0100 | 
| commit | 2c0963dbc44bd03abbaa4ae8424d893df57ff8b2 (patch) | |
| tree | 7a0cb01be2685b5569fe4e3ae63d12f85ba6b9ba | |
| parent | c18d4f065c9529c62a82bc2a3bd518da318d89ff (diff) | |
| download | vimium-2c0963dbc44bd03abbaa4ae8424d893df57ff8b2.tar.bz2 | |
Simulate default click action for <a target="_blank">s
| -rw-r--r-- | lib/dom_utils.coffee | 5 | 
1 files changed, 3 insertions, 2 deletions
| diff --git a/lib/dom_utils.coffee b/lib/dom_utils.coffee index 65a14c34..c2d83b1d 100644 --- a/lib/dom_utils.coffee +++ b/lib/dom_utils.coffee @@ -276,8 +276,7 @@ DomUtils =        # but Webkit will. Dispatching a click on an input box does not seem to focus it; we do that separately        element.dispatchEvent(mouseEvent) -  simulateClickDefaultAction: (element, modifiers) -> -    return unless modifiers? +  simulateClickDefaultAction: (element, modifiers = {}) ->      return unless element.tagName?.toLowerCase() == "a" and element.href?      {ctrlKey, shiftKey, metaKey, altKey} = modifiers @@ -295,6 +294,8 @@ DomUtils =      else if shiftKey == true and metaKey == false and ctrlKey == false and altKey == false        # Open in new window.        chrome.runtime.sendMessage {handler: "openUrlInNewWindow", url: element.href} +    else if element.target == "_blank" +      chrome.runtime.sendMessage {handler: "openUrlInNewTab", url: element.href, active: true}      return | 
