aboutsummaryrefslogtreecommitdiffstats
path: root/content_scripts/vimium_frontend.coffee
diff options
context:
space:
mode:
authorStephen Blott2016-04-17 11:13:27 +0100
committerStephen Blott2016-04-17 11:43:18 +0100
commitd43f18bd5ce7c39e8e663a657027b233707e2926 (patch)
tree6f2dd003f5f17f3eae9921da24d1c11cd84ba9ee /content_scripts/vimium_frontend.coffee
parent025b7f930205e9dfbae5f2dff5c7c1fd4a45e4c1 (diff)
downloadvimium-d43f18bd5ce7c39e8e663a657027b233707e2926.tar.bz2
More code review of UI-component focus handling.
Diffstat (limited to 'content_scripts/vimium_frontend.coffee')
-rw-r--r--content_scripts/vimium_frontend.coffee10
1 files changed, 4 insertions, 6 deletions
diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee
index 3c429115..7d6fa9a0 100644
--- a/content_scripts/vimium_frontend.coffee
+++ b/content_scripts/vimium_frontend.coffee
@@ -159,8 +159,7 @@ initializePreDomReady = ->
getScrollPosition: (ignoredA, ignoredB, sendResponse) ->
sendResponse scrollX: window.scrollX, scrollY: window.scrollY if frameId == 0
setScrollPosition: setScrollPosition
- # A frame has received the focus. We don't care here (UI components handle this).
- frameFocused: ->
+ frameFocused: -> # A frame has received the focus; we don't care here (UI components handle this).
checkEnabledAfterURLChange: checkEnabledAfterURLChange
runInTopFrame: ({sourceFrameId, registryEntry}) ->
Utils.invokeCommandString registryEntry.command, sourceFrameId, registryEntry if DomUtils.isTopFrame()
@@ -291,10 +290,9 @@ DomUtils.documentReady ->
#
focusThisFrame = (request) ->
unless request.forceFocusThisFrame
- skipThisFrame = DomUtils.windowIsTooSmall() # Frame is too small; see #1317.
- skipThisFrame ||= document.body?.tagName.toLowerCase() == "frameset"
- if skipThisFrame
- # Cancel and tell the background page to focus the next frame instead.
+ 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.
chrome.runtime.sendMessage handler: "nextFrame"
return
window.focus()