aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--background_scripts/main.coffee1
-rw-r--r--content_scripts/vimium_frontend.coffee6
2 files changed, 7 insertions, 0 deletions
diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee
index 17d21bc4..3753fd75 100644
--- a/background_scripts/main.coffee
+++ b/background_scripts/main.coffee
@@ -639,6 +639,7 @@ sendRequestHandlers =
registerFrame: registerFrame
unregisterFrame: unregisterFrame
frameFocused: handleFrameFocused
+ nextFrame: (request) -> BackgroundCommands.nextFrame 1, request.frameId
upgradeNotificationClosed: upgradeNotificationClosed
updateScrollPosition: handleUpdateScrollPosition
copyToClipboard: copyToClipboard
diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee
index 96a7e461..eaf66b72 100644
--- a/content_scripts/vimium_frontend.coffee
+++ b/content_scripts/vimium_frontend.coffee
@@ -244,6 +244,12 @@ setScrollPosition = (scrollX, scrollY) ->
# Called from the backend in order to change frame focus.
#
window.focusThisFrame = (shouldHighlight) ->
+ if window.innerWidth < 3 or window.innerHeight < 3
+ # This frame is too small to focus. Cancel and tell the background frame to focus the next one instead.
+ # NOTE(smblott) We assume that there is at least one frame large enough to focus.
+ # See #1317.
+ chrome.runtime.sendMessage({ handler: "nextFrame", frameId: frameId })
+ return
window.focus()
if (document.body && shouldHighlight)
borderWas = document.body.style.border