From 11b879f6d49f6f5c08cd3276ab871d1ccffb179d Mon Sep 17 00:00:00 2001 From: Ilya Sukhar Date: Fri, 24 Sep 2010 00:37:21 -0700 Subject: Fix some frame logic and disable focusing the largest one for now because it's buggy with iframes. --- background_page.html | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'background_page.html') diff --git a/background_page.html b/background_page.html index b862a881..48084f77 100644 --- a/background_page.html +++ b/background_page.html @@ -604,15 +604,20 @@ } function registerFrame(request, sender) { - if (request.top) - framesForTab[sender.tab.id] = { total: request.total, frames: [] }; - else { - framesForTab[sender.tab.id].frames.push({ id: request.frameId, area: request.area }); + if (!framesForTab[sender.tab.id]) + framesForTab[sender.tab.id] = { frames: [] }; - // We've seen all the frames. Time to focus the largest one. - if (framesForTab[sender.tab.id].frames.length == framesForTab[sender.tab.id].total) - focusLargestFrame(sender.tab.id); + if (request.top) { + focusedFrame = request.frameId; + framesForTab[sender.tab.id].total = request.total; } + + framesForTab[sender.tab.id].frames.push({ id: request.frameId, area: request.area }); + + // We've seen all the frames. Time to focus the largest one. + // NOTE: Disabled because it's buggy with iframes. + // if (framesForTab[sender.tab.id].frames.length >= framesForTab[sender.tab.id].total) + // focusLargestFrame(sender.tab.id); } function focusLargestFrame(tabId) { -- cgit v1.2.3