diff options
| author | mrmr1993 | 2017-09-21 21:47:46 +0100 |
|---|---|---|
| committer | mrmr1993 | 2017-09-21 22:05:53 +0100 |
| commit | 92d2b4058a378c276d52ecc53409603679c3865c (patch) | |
| tree | 89b359d6dfb28c0f6484bfbb76cbe5109338d39b /content_scripts/link_hints.coffee | |
| parent | 7fa22da6954d28dbd578b0cd490ada638d98b373 (diff) | |
| download | vimium-92d2b4058a378c276d52ecc53409603679c3865c.tar.bz2 | |
Move simulating click default action to DomUtils, add shift handling
Diffstat (limited to 'content_scripts/link_hints.coffee')
| -rw-r--r-- | content_scripts/link_hints.coffee | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/content_scripts/link_hints.coffee b/content_scripts/link_hints.coffee index 0fbb66bf..eeadfc0c 100644 --- a/content_scripts/link_hints.coffee +++ b/content_scripts/link_hints.coffee @@ -384,17 +384,7 @@ class LinkHintsMode window.focus() DomUtils.simulateSelect clickEl else - clickActivator = (modifiers) -> (link) -> - defaultActionsTriggered = DomUtils.simulateClick link, modifiers - simulateClickDefaultAction = Utils.isFirefox() - if simulateClickDefaultAction and - defaultActionsTriggered[3] and link.tagName?.toLowerCase() == "a" and - modifiers? and modifiers.metaKey == isMac and modifiers.ctrlKey == not isMac - # We've clicked a link that *should* open in a new tab. If simulateClickDefaultAction is true, - # we assume the popup-blocker is active, and simulate opening the new tab ourselves. - chrome.runtime.sendMessage {handler: "openUrlInNewTab", url: link.href, active: - modifiers.shiftKey == true} - + clickActivator = (modifiers) -> (link) -> DomUtils.simulateClick link, modifiers linkActivator = @mode.linkActivator ? clickActivator @mode.clickModifiers # TODO: Are there any other input elements which should not receive focus? if clickEl.nodeName.toLowerCase() in ["input", "select"] and clickEl.type not in ["button", "submit"] |
