From 061e99f895e5655d351ad1585af028a12abf3ec0 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Mon, 27 Apr 2015 16:49:04 +0100 Subject: Enable grab-back-focus after web navigation. Fixes #1588. (??) --- content_scripts/vimium_frontend.coffee | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'content_scripts') diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee index e7aea163..28102527 100644 --- a/content_scripts/vimium_frontend.coffee +++ b/content_scripts/vimium_frontend.coffee @@ -609,7 +609,10 @@ 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() + if windowIsFocused() + checkIfEnabledForUrl() + # We also grab back the focus. See #1588. + new GrabBackFocus # Exported to window, but only for DOM tests. window.refreshCompletionKeys = (response) -> -- cgit v1.2.3 From f1e46d8145c834a712f6be7c1e5bd590c72da749 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Tue, 28 Apr 2015 07:49:13 +0100 Subject: Only grab focus after link transition. --- content_scripts/vimium_frontend.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'content_scripts') diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee index 28102527..14891707 100644 --- a/content_scripts/vimium_frontend.coffee +++ b/content_scripts/vimium_frontend.coffee @@ -608,11 +608,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 = -> +checkEnabledAfterURLChange = (request) -> if windowIsFocused() checkIfEnabledForUrl() # We also grab back the focus. See #1588. - new GrabBackFocus + new GrabBackFocus() if request.transitionType in [ "link", "form_submit" ] # Exported to window, but only for DOM tests. window.refreshCompletionKeys = (response) -> -- cgit v1.2.3