       state.onUpdate(value)
 
 initializePreDomReady()
+window.addEventListener("DOMContentLoaded", registerFrame)
 window.addEventListener("DOMContentLoaded", initializeOnDomReady)
 window.addEventListener("unload", unregisterFrame)
 

  chrome.runtime.sendMessage(
    handler: "registerFrame"
    frameId: frameId
    is_top: window.top == window.self
    total: frames.length + 1)

# Unregister the frame if we're going to exit.
unregisterFrame = ->

# Initialization tasks that must wait for the document to be ready.
#
initializeOnDomReady = ->
  enterInsertModeIfElementIsFocused() if isEnabledForUrl

  # Tell the background page we're in the dom ready state.
