aboutsummaryrefslogtreecommitdiffstats
path: root/content_scripts
diff options
context:
space:
mode:
authorStephen Blott2015-04-28 09:58:01 +0100
committerStephen Blott2015-04-28 09:58:01 +0100
commit03c5b0839e0b6ccc1d243fe1cafafda6221c7f37 (patch)
treeebf1dfa1f9a9024fcb7b4b99df2093bea641d514 /content_scripts
parentfe8e0898d1ed563dacb119c50f026a181f144fa2 (diff)
parentf1e46d8145c834a712f6be7c1e5bd590c72da749 (diff)
downloadvimium-03c5b0839e0b6ccc1d243fe1cafafda6221c7f37.tar.bz2
Merge pull request #1609 from smblott-github/fix-grab-back-focus-after-web-navigation
Fix grab back focus after web navigation
Diffstat (limited to 'content_scripts')
-rw-r--r--content_scripts/vimium_frontend.coffee7
1 files changed, 5 insertions, 2 deletions
diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee
index 2ae2e3e6..46c993c8 100644
--- a/content_scripts/vimium_frontend.coffee
+++ b/content_scripts/vimium_frontend.coffee
@@ -611,8 +611,11 @@ checkIfEnabledForUrl = (frameIsFocused = windowIsFocused()) ->
# When we're informed by the background page that a URL in this tab has changed, we check if we have the
# correct enabled state (but only if this frame has the focus).
-checkEnabledAfterURLChange = ->
- checkIfEnabledForUrl() if windowIsFocused()
+checkEnabledAfterURLChange = (request) ->
+ if windowIsFocused()
+ checkIfEnabledForUrl()
+ # We also grab back the focus. See #1588.
+ new GrabBackFocus() if request.transitionType in [ "link", "form_submit" ]
# Exported to window, but only for DOM tests.
window.refreshCompletionKeys = (response) ->