diff options
| author | mrmr1993 | 2017-04-20 17:34:46 +0100 | 
|---|---|---|
| committer | mrmr1993 | 2017-04-20 17:34:46 +0100 | 
| commit | df72a1be0213d211645f39f1ec6aeeba4d8e7896 (patch) | |
| tree | b0d27897f01faf8149a470213f80a1c1fe08bffd | |
| parent | e3cce413029dd5efa718a48a057d0bcf77d31fb9 (diff) | |
| download | vimium-df72a1be0213d211645f39f1ec6aeeba4d8e7896.tar.bz2 | |
Blur the focused iframe when restoring window focus
This works around FF issue 554039, which prevents window.top.focus()
from working.
| -rw-r--r-- | content_scripts/vimium_frontend.coffee | 3 | 
1 files changed, 3 insertions, 0 deletions
| diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee index cdb23352..e84346e1 100644 --- a/content_scripts/vimium_frontend.coffee +++ b/content_scripts/vimium_frontend.coffee @@ -315,6 +315,9 @@ focusThisFrame = (request) ->        chrome.runtime.sendMessage handler: "nextFrame"        return    window.focus() +  # On Firefox, window.focus doesn't always draw focus back from a child frame (bug 554039). +  # We blur the active element if it is an iframe, which gives the window back focus as intended. +  document.activeElement.blur() if document.activeElement.tagName.toLowerCase() == "iframe"    flashFrame() if request.highlight  extend window, | 
