aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Blott2015-05-18 14:36:27 +0100
committerStephen Blott2015-05-18 14:36:27 +0100
commit6b4dcfeac3abfb7743536115790a2d8cc52a64f5 (patch)
tree0abf05479307bce2a12c389c867aff4cbddd84b4
parentc17b4618a3ae5513f7ea67fa6c872829de9f9bba (diff)
downloadvimium-6b4dcfeac3abfb7743536115790a2d8cc52a64f5.tar.bz2
Fix vomnibar stuck open.
See #1671. The problem was that we were making the vomnibar visible in the frontend, even if the vomnibar initialisation was not yet complete, and the iframe port was not yet available. (Also, @activate() is never being called without options, so we can drop that test.) Fixes #1671.
-rw-r--r--content_scripts/ui_component.coffee8
1 files changed, 5 insertions, 3 deletions
diff --git a/content_scripts/ui_component.coffee b/content_scripts/ui_component.coffee
index 938a8411..e7cd3f82 100644
--- a/content_scripts/ui_component.coffee
+++ b/content_scripts/ui_component.coffee
@@ -45,14 +45,16 @@ class UIComponent
chrome.storage.local.get "vimiumSecret", ({vimiumSecret: secret}) =>
@iframeElement.contentWindow.postMessage secret, chrome.runtime.getURL(""), [messageChannel.port2]
+ # Posts a message; returns true if the message was sent, false otherwise.
postMessage: (message) ->
# We use "?" here because the iframe port is initialized asynchronously, and may not yet be ready.
@iframePort?.postMessage message
+ @iframePort?
activate: (@options) ->
- @postMessage @options if @options?
- @show() unless @showing
- @iframeElement.focus()
+ if @postMessage @options
+ @show() unless @showing
+ @iframeElement.focus()
show: (message) ->
@postMessage message if message?