aboutsummaryrefslogtreecommitdiffstats
path: root/content_scripts
diff options
context:
space:
mode:
authorStephen Blott2016-04-16 16:36:35 +0100
committerStephen Blott2016-04-16 16:36:35 +0100
commitae1a54157291c0bcc69a6e8652bc15e69b72b4e4 (patch)
treeae25915c3724e6bd663ea6b4211fdba0cc5cfd2b /content_scripts
parente60066218806ca42ebe94fd1ce0042993909658d (diff)
downloadvimium-ae1a54157291c0bcc69a6e8652bc15e69b72b4e4.tar.bz2
Do not focus a hidden help dialog.
When the help dialog UI component has been created but subsequently hidden, `gf` was nevertheless selecting it.
Diffstat (limited to 'content_scripts')
-rw-r--r--content_scripts/vimium_frontend.coffee8
1 files changed, 5 insertions, 3 deletions
diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee
index 023952c1..56f7742e 100644
--- a/content_scripts/vimium_frontend.coffee
+++ b/content_scripts/vimium_frontend.coffee
@@ -291,9 +291,11 @@ DomUtils.documentReady ->
#
focusThisFrame = (request) ->
unless request.forceFocusThisFrame
- if DomUtils.windowIsTooSmall() or document.body?.tagName.toLowerCase() == "frameset"
- # This frame is too small to focus or it's a frameset. Cancel and tell the background page to focus the
- # next frame instead. This affects sites like Google Inbox, which have many tiny iframes. See #1317.
+ skipThisFrame = DomUtils.windowIsTooSmall() # Frame is too small; see #1317.
+ skipThisFrame ||= document.body?.tagName.toLowerCase() == "frameset"
+ skipThisFrame ||= window.isVimiumUIComponent and not HelpDialog.showing
+ if skipThisFrame
+ # Cancel and tell the background page to focus the next frame instead.
chrome.runtime.sendMessage handler: "nextFrame"
return
window.focus()