aboutsummaryrefslogtreecommitdiffstats
path: root/content_scripts
diff options
context:
space:
mode:
authorStephen Blott2016-04-14 10:35:23 +0100
committerStephen Blott2016-04-14 10:35:23 +0100
commitf1cb5a70fac210eaaa33609c1a4553b04f00b910 (patch)
treed71f83349ddb190639f5a2af7accfa2fca35f9d1 /content_scripts
parentf9c00d9d56373566c034685d0e4bb99ff3b0367b (diff)
parent39115e921af964a73d49da3085319fc1160009d2 (diff)
downloadvimium-f1cb5a70fac210eaaa33609c1a4553b04f00b910.tar.bz2
Merge pull request #2097 from smblott-github/ui-component-init-sequence
Rework UI component init sequence.
Diffstat (limited to 'content_scripts')
-rw-r--r--content_scripts/ui_component.coffee5
1 files changed, 2 insertions, 3 deletions
diff --git a/content_scripts/ui_component.coffee b/content_scripts/ui_component.coffee
index 92640eb2..d7bdf2a1 100644
--- a/content_scripts/ui_component.coffee
+++ b/content_scripts/ui_component.coffee
@@ -45,7 +45,8 @@ class UIComponent
# Get vimiumSecret so the iframe can determine that our message isn't the page impersonating us.
chrome.storage.local.get "vimiumSecret", ({ vimiumSecret }) =>
{ port1, port2 } = new MessageChannel
- port1.onmessage = (event) => @handleMessage event
+ port1.onmessage = (event) =>
+ if event?.data == "uiComponentIsReady" then @uiComponentIsReady = true else @handleMessage event
@iframeElement.contentWindow.postMessage vimiumSecret, chrome.runtime.getURL(""), [ port2 ]
setIframePort port1
@@ -54,8 +55,6 @@ class UIComponent
@postMessage name: "frameFocused", focusFrameId: request.focusFrameId
false # Free up the sendResponse handler.
- @styleSheetGetter.use => @iframePort.use => Utils.nextTick => @uiComponentIsReady = true
-
# Posts a message (if one is provided), then calls continuation (if provided). The continuation is only
# ever called *after* the message has been posted.
postMessage: (message = null, continuation = null) ->