aboutsummaryrefslogtreecommitdiffstats
path: root/background_scripts
diff options
context:
space:
mode:
authorStephen Blott2016-04-02 16:54:11 +0100
committerStephen Blott2016-04-02 17:02:41 +0100
commit96c74e4aa7e39a99bf5511440ba7a4155f1e2db8 (patch)
tree10ac55d9efa915c4f17522961554e4540e3607e2 /background_scripts
parent4f74307ed382ce942a1210007b99ed426f997a81 (diff)
downloadvimium-96c74e4aa7e39a99bf5511440ba7a4155f1e2db8.tar.bz2
Simplify UI component initialisation.
There's no need for the previous complicated approach to UI component initialialisation, in particular for the Vomnibar. We only initialise the Vomnibar in the top frame. However, if for some reason it hasn't been initialised by the time it's needed, then we can just initialise it then. We are only initialising it early to avoid flicker, so it's not a correctness issue. And the only reason it wouldn't be initialised is if Vimium is disabled in the top frame, but enabled in some other frame -- which is not a common case.
Diffstat (limited to 'background_scripts')
-rw-r--r--background_scripts/main.coffee5
1 files changed, 0 insertions, 5 deletions
diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee
index dea436ef..2a5b738e 100644
--- a/background_scripts/main.coffee
+++ b/background_scripts/main.coffee
@@ -291,8 +291,6 @@ Frames =
onConnect: (sender, port) ->
[tabId, frameId] = [sender.tab.id, sender.frameId]
port.postMessage handler: "registerFrameId", chromeFrameId: frameId
- # We only register the top frame automatically; other frames request registration via "registerFrame".
- @registerFrame {tabId, frameId, port} if frameId == 0
port.onDisconnect.addListener listener = ->
# Unregister the frame. However, we never unregister the main/top frame. If the tab is navigating to
@@ -334,9 +332,6 @@ Frames =
tabLoadedHandlers[tabId]?()
delete tabLoadedHandlers[tabId]
- initializeTopFrameUIComponents: ({tabId}) ->
- portsForTab[tabId][0]?.postMessage handler: "initializeTopFrameUIComponents"
-
linkHintsMessage: ({request, tabId, frameId}) ->
HintCoordinator.onMessage tabId, frameId, request