From ae1a54157291c0bcc69a6e8652bc15e69b72b4e4 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sat, 16 Apr 2016 16:36:35 +0100 Subject: Do not focus a hidden help dialog. When the help dialog UI component has been created but subsequently hidden, `gf` was nevertheless selecting it. --- content_scripts/vimium_frontend.coffee | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'content_scripts') 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() -- cgit v1.2.3