aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--background_scripts/main.coffee1
-rw-r--r--content_scripts/vimium_frontend.coffee4
2 files changed, 5 insertions, 0 deletions
diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee
index 3ec618c9..647923c0 100644
--- a/background_scripts/main.coffee
+++ b/background_scripts/main.coffee
@@ -633,6 +633,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 16783bda..4ab6556f 100644
--- a/content_scripts/vimium_frontend.coffee
+++ b/content_scripts/vimium_frontend.coffee
@@ -225,6 +225,10 @@ 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.
+ chrome.runtime.sendMessage({ handler: "nextFrame", frameId: frameId })
+ return
window.focus()
if (document.body && shouldHighlight)
borderWas = document.body.style.border