aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormrmr19932014-11-23 10:25:30 +0000
committermrmr19932014-11-23 11:57:47 +0000
commit70cb13bfbd39eba5f2ca06bba35ea5a69dd16fc8 (patch)
tree6668cbafe6a97d3db72ab7b7a918dd6e4810c672
parent3c24c79b09735536e883dea6a00fb436979bb990 (diff)
downloadvimium-70cb13bfbd39eba5f2ca06bba35ea5a69dd16fc8.tar.bz2
Remove redundant code, add a new listener to be more consistent
-rw-r--r--content_scripts/vimium_frontend.coffee6
1 files changed, 2 insertions, 4 deletions
diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee
index 8b32c98b..fd31cc62 100644
--- a/content_scripts/vimium_frontend.coffee
+++ b/content_scripts/vimium_frontend.coffee
@@ -179,8 +179,6 @@ window.addEventListener "focus", ->
# Initialization tasks that must wait for the document to be ready.
#
initializeOnDomReady = ->
- registerFrame()
-
enterInsertModeIfElementIsFocused() if isEnabledForUrl
# Tell the background page we're in the dom ready state.
@@ -190,8 +188,7 @@ registerFrame = ->
chrome.runtime.sendMessage(
handler: "registerFrame"
frameId: frameId
- is_top: window.top == window.self
- total: frames.length + 1)
+ is_top: window.top == window.self)
# Unregister the frame if we're going to exit.
unregisterFrame = ->
@@ -1062,6 +1059,7 @@ Tween =
state.onUpdate(value)
initializePreDomReady()
+window.addEventListener("DOMContentLoaded", registerFrame)
window.addEventListener("DOMContentLoaded", initializeOnDomReady)
window.addEventListener("unload", unregisterFrame)