diff options
| author | Stephen Blott | 2015-03-17 11:42:58 +0000 | 
|---|---|---|
| committer | Stephen Blott | 2015-03-17 11:42:58 +0000 | 
| commit | 8bc811aae1118e28faa7c17e67b039c67f637274 (patch) | |
| tree | 702f28f1d88fef438a717895ede5107409df54be /content_scripts/vimium_frontend.coffee | |
| parent | 9461d30b0d19fd65dc43e18bebec1fe0fd3ee818 (diff) | |
| download | vimium-8bc811aae1118e28faa7c17e67b039c67f637274.tar.bz2 | |
Activate vomnibar in window.top; hide on focus, fixed.
Diffstat (limited to 'content_scripts/vimium_frontend.coffee')
| -rw-r--r-- | content_scripts/vimium_frontend.coffee | 20 | 
1 files changed, 13 insertions, 7 deletions
diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee index 941b2bc2..90b25a40 100644 --- a/content_scripts/vimium_frontend.coffee +++ b/content_scripts/vimium_frontend.coffee @@ -94,7 +94,12 @@ settings =  #  # Give this frame a unique id.  # -frameId = Math.floor(Math.random()*999999999) +window.frameId = Math.floor(Math.random()*999999999) + +# For debugging only. This logs to the console on the background page. +window.bgLog = (args...) -> +  args = (arg.toString() for arg in args) +  chrome.runtime.sendMessage handler: "log", frameId: frameId, message: args.join " "  # If an input grabs the focus before the user has interacted with the page, then grab it back (if the  # grabBackFocus option is set). @@ -230,12 +235,13 @@ getActiveState = ->  #  # The backend needs to know which frame has focus.  # -registerFocus = -> -  # settings may have changed since the frame last had focus -  settings.load() -  # Don't register frameset containers; focusing them is no use. -  unless document.body?.tagName.toLowerCase() == "frameset" -    chrome.runtime.sendMessage({ handler: "frameFocused", frameId: frameId }) +registerFocus = (event) -> +  if event.target == window +    # settings may have changed since the frame last had focus +    settings.load() +    # Don't register frameset containers; focusing them is no use. +    unless document.body?.tagName.toLowerCase() == "frameset" +      chrome.runtime.sendMessage({ handler: "frameFocused", frameId: frameId })  #  # Initialization tasks that must wait for the document to be ready.  | 
