aboutsummaryrefslogtreecommitdiffstats
path: root/content_scripts/vimium_frontend.coffee
diff options
context:
space:
mode:
Diffstat (limited to 'content_scripts/vimium_frontend.coffee')
-rw-r--r--content_scripts/vimium_frontend.coffee9
1 files changed, 7 insertions, 2 deletions
diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee
index 693c0c46..b1e82a75 100644
--- a/content_scripts/vimium_frontend.coffee
+++ b/content_scripts/vimium_frontend.coffee
@@ -138,12 +138,15 @@ installModes = ->
initializeOnEnabledStateKnown = Utils.makeIdempotent ->
installModes()
+registerFrame = ->
+ Frame.postMessage "registerFrame"
+
#
# Complete initialization work that sould be done prior to DOMReady.
#
initializePreDomReady = ->
installListeners()
- Frame.init()
+ Frame.init registerFrame
checkIfEnabledForUrl()
requestHandlers =
@@ -214,7 +217,7 @@ Frame =
registerFrameId: ({chromeFrameId}) -> frameId = window.frameId = chromeFrameId
linkHintsMessage: (request) -> HintCoordinator[request.messageType] request
- init: (callback) ->
+ init: (callback = null) ->
@port = chrome.runtime.connect name: "frames"
@port.onMessage.addListener (request) =>
@@ -225,6 +228,8 @@ Frame =
isEnabledForUrl = false
window.removeEventListener "focus", onFocus
+ callback?()
+
setScrollPosition = ({ scrollX, scrollY }) ->
if DomUtils.isTopFrame()
DomUtils.documentReady ->