From 6b4dcfeac3abfb7743536115790a2d8cc52a64f5 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Mon, 18 May 2015 14:36:27 +0100 Subject: 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. --- content_scripts/ui_component.coffee | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'content_scripts') 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? -- cgit v1.2.3