From 6e12e005a4261711583571be23018481a4a23230 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sun, 10 Apr 2016 12:41:26 +0100 Subject: Fix Vomnibar initialization issue. On a slow loading page, as the page is loading, hit `o` repeatedly. Eventually, Vimium hangs. We seem to have had this problem for quite some time (e.g. it's in 1.54). This fixes the problem by ensuring that the Vomnibar is initialized before launching it. Also fix the same issue for the help dialog. --- content_scripts/vimium_frontend.coffee | 2 +- content_scripts/vomnibar.coffee | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'content_scripts') diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee index 39e87648..f36b3e8c 100644 --- a/content_scripts/vimium_frontend.coffee +++ b/content_scripts/vimium_frontend.coffee @@ -635,7 +635,7 @@ window.HelpDialog ?= @helpUI = new UIComponent "pages/help_dialog.html", "vimiumHelpDialogFrame", (event) => @hide() if event.data == "hide" - isReady: -> @helpUI? + isReady: -> @helpUI?.uiComponentIsReady show: (html) -> @init() diff --git a/content_scripts/vomnibar.coffee b/content_scripts/vomnibar.coffee index a19a9b70..c23a4e6f 100644 --- a/content_scripts/vomnibar.coffee +++ b/content_scripts/vomnibar.coffee @@ -64,7 +64,8 @@ Vomnibar = # newTab - Optional, boolean. Whether to open the result in a new tab. open: (sourceFrameId, options) -> @init() - @vomnibarUI.activate extend options, { sourceFrameId } + if @vomnibarUI?.uiComponentIsReady + @vomnibarUI.activate extend options, { sourceFrameId } root = exports ? window root.Vomnibar = Vomnibar -- cgit v1.2.3