aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Blott2015-04-28 06:48:31 +0100
committerStephen Blott2015-04-28 06:48:31 +0100
commit693dfecba05e6aaa1c32332fc3a0377d387f2a34 (patch)
treed17698373d9d4fd50538b1046a3c0f620f3047e4
parentd6b195ea85b06dcab8d66d047f8c494c3304e88e (diff)
parentcfb137d515e6f214322538fdd9a8e236445b63b0 (diff)
downloadvimium-693dfecba05e6aaa1c32332fc3a0377d387f2a34.tar.bz2
Merge pull request #1608 from smblott-github/grab-back-focus-only-if-enabled
Do not grab back focus if Vimium is disabled.
-rw-r--r--content_scripts/vimium_frontend.coffee5
1 files changed, 4 insertions, 1 deletions
diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee
index e7aea163..b322af53 100644
--- a/content_scripts/vimium_frontend.coffee
+++ b/content_scripts/vimium_frontend.coffee
@@ -149,7 +149,6 @@ window.initializeModes = ->
new NormalMode
new PassKeysMode
new InsertMode permanent: true
- new GrabBackFocus
Scroller.init settings
#
@@ -159,6 +158,8 @@ initializePreDomReady = ->
settings.addEventListener("load", LinkHints.init.bind(LinkHints))
settings.load()
+ # Note. checkIfEnabledForUrl() must come after initializeModes(), here, because checkIfEnabledForUrl() may
+ # install an additional mode (GrabBackFocus).
initializeModes()
checkIfEnabledForUrl()
refreshCompletionKeys()
@@ -229,7 +230,9 @@ window.installListeners = ->
do (type) -> installListener window, type, (event) -> handlerStack.bubbleEvent type, event
installListener document, "DOMActivate", (event) -> handlerStack.bubbleEvent 'DOMActivate', event
installedListeners = true
+ # Other one-time initialization operations.
FindModeHistory.init()
+ new GrabBackFocus if isEnabledForUrl
#
# Whenever we get the focus: