aboutsummaryrefslogtreecommitdiffstats
path: root/content_scripts/vimium_frontend.coffee
diff options
context:
space:
mode:
authorStephen Blott2016-04-17 16:17:38 +0100
committerStephen Blott2016-04-17 16:19:08 +0100
commit4b564e8517dd3415cb8e2209ce019fa024e88770 (patch)
treebe4e76270a1b0fdffc58c1a706cc4983e57b23d9 /content_scripts/vimium_frontend.coffee
parent5327d51946fa86ed494c7b5cd2ba39fb79d8e9e9 (diff)
downloadvimium-4b564e8517dd3415cb8e2209ce019fa024e88770.tar.bz2
Only Vomnibar.init() when the Vomnibar is needed.
The Vomnibar isn't needed on most tabs, so don't init it. I cannot detect any sluggishness as a result of this.
Diffstat (limited to 'content_scripts/vimium_frontend.coffee')
-rw-r--r--content_scripts/vimium_frontend.coffee12
1 files changed, 2 insertions, 10 deletions
diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee
index 312c6bbe..a80093f9 100644
--- a/content_scripts/vimium_frontend.coffee
+++ b/content_scripts/vimium_frontend.coffee
@@ -141,9 +141,6 @@ installModes = ->
initializeOnEnabledStateKnown = Utils.makeIdempotent ->
installModes()
-initializeUIComponents = Utils.makeIdempotent -> DomUtils.documentReady ->
- Vomnibar.init() if DomUtils.isTopFrame()
-
#
# Complete initialization work that should be done prior to DOMReady.
#
@@ -455,13 +452,8 @@ checkIfEnabledForUrl = do ->
{isEnabledForUrl, passKeys, frameIsFocused} = response
initializeOnEnabledStateKnown()
normalMode.setPassKeys passKeys
- # Initialize UI components, if necessary. We only initialize these once we know that Vimium is enabled;
- # see #1838. We need to check this every time so that we can change state from disabled to enabled.
- if isEnabledForUrl
- initializeUIComponents() if frameIsFocused
- else
- # Hide the HUD if we're not enabled.
- HUD.hide true, false # Immediate, do not update indicator.
+ # Hide the HUD if we're not enabled.
+ HUD.hide true, false unless isEnabledForUrl
(frameIsFocused = windowIsFocused()) ->
Frame.postMessage "isEnabledForUrl", {frameIsFocused, url: window.location.toString()}