diff options
| -rw-r--r-- | background_scripts/main.coffee | 2 | ||||
| -rw-r--r-- | content_scripts/vimium_frontend.coffee | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee index 3a3392d8..559a904d 100644 --- a/background_scripts/main.coffee +++ b/background_scripts/main.coffee @@ -100,7 +100,7 @@ root.isEnabledForUrl = isEnabledForUrl = (request, sender) -> } onURLChange = (details) -> - chrome.tabs.sendMessage details.tabId, name: "checkEnabledAfterURLChange" + chrome.tabs.sendMessage details.tabId, extend details, name: "checkEnabledAfterURLChange" # Re-check whether Vimium is enabled for a frame when the url changes without a reload. chrome.webNavigation.onHistoryStateUpdated.addListener onURLChange # history.pushState. 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) -> |
