aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Blott2014-12-16 15:44:06 +0000
committerStephen Blott2014-12-16 15:44:06 +0000
commitdb4b0c952fdf8fff517a4393cd07b04ecffb2ead (patch)
treee408b558a889d8bc758ad2530d0fe35a9ec23184
parent0b3a242841f7badb069840dec80a24d38d4e843a (diff)
parenta36a735fca856bb59dd62b6bc77c56431cc9b9fd (diff)
downloadvimium-db4b0c952fdf8fff517a4393cd07b04ecffb2ead.tar.bz2
Merge branch 'master' into post-1.46
Conflicts: background_scripts/main.coffee
-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