aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormrmr19932014-11-23 12:45:11 +0000
committermrmr19932014-11-23 12:45:11 +0000
commit3863e724241408338c9c69af72117584c1258d34 (patch)
treed5b3bf01915d775065640902f8405ae8b32df55c
parente7d3f29cb5e3bdcf55ab18c127564ebfbb4d5259 (diff)
downloadvimium-3863e724241408338c9c69af72117584c1258d34.tar.bz2
Don't record frameIds for frames only containing a frameset
Frameset frames have no content of their own -- they only embed other pages in sub-frames. The user can't perform any actions (of ours or the browsers) with a frameset focused, so we might as well just not focus it.
-rw-r--r--background_scripts/main.coffee3
-rw-r--r--content_scripts/vimium_frontend.coffee6
2 files changed, 6 insertions, 3 deletions
diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee
index 0c969aed..aac63213 100644
--- a/background_scripts/main.coffee
+++ b/background_scripts/main.coffee
@@ -598,6 +598,7 @@ openOptionsPageInNewTab = ->
registerFrame = (request, sender) ->
frames = frameIdsForTab[sender.tab.id] ?= []
+ return if request.is_frameset # Don't store frameset containers; focusing them is no use.
if request.is_top
frames.unshift request.frameId
else
@@ -609,7 +610,7 @@ unregisterFrame = (request, sender) ->
if request.is_top # The whole tab is closing, so we can drop the frames list.
updateOpenTabs sender.tab
- else
+ else if not request.if_frameset
index = frames.indexOf request.frameId
return if index == -1
frames.splice index, 1
diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee
index fd31cc62..62b1132b 100644
--- a/content_scripts/vimium_frontend.coffee
+++ b/content_scripts/vimium_frontend.coffee
@@ -188,14 +188,16 @@ registerFrame = ->
chrome.runtime.sendMessage(
handler: "registerFrame"
frameId: frameId
- is_top: window.top == window.self)
+ is_top: window.top == window.self
+ is_frameset: document.body.tagName == "FRAMESET")
# Unregister the frame if we're going to exit.
unregisterFrame = ->
chrome.runtime.sendMessage(
handler: "unregisterFrame"
frameId: frameId
- is_top: window.top == window.self)
+ is_top: window.top == window.self
+ is_frameset: document.body.tagName == "FRAMESET")
#
# Enters insert mode if the currently focused element in the DOM is focusable.