diff options
| author | Ilya Sukhar | 2010-09-24 00:37:21 -0700 |
|---|---|---|
| committer | Ilya Sukhar | 2010-09-24 00:37:21 -0700 |
| commit | 11b879f6d49f6f5c08cd3276ab871d1ccffb179d (patch) | |
| tree | ae7d768b9f56a21140a42afab852be64e5e5b178 /vimiumFrontend.js | |
| parent | 0370d60be82aead007f6b0804dd5b90e6fdb1b1c (diff) | |
| download | vimium-11b879f6d49f6f5c08cd3276ab871d1ccffb179d.tar.bz2 | |
Fix some frame logic and disable focusing the largest one for now because it's buggy with iframes.
Diffstat (limited to 'vimiumFrontend.js')
| -rw-r--r-- | vimiumFrontend.js | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/vimiumFrontend.js b/vimiumFrontend.js index 3b73144a..d7c429cb 100644 --- a/vimiumFrontend.js +++ b/vimiumFrontend.js @@ -170,10 +170,7 @@ function focusThisFrame(shouldHighlight) { * Initialization tasks that must wait for the document to be ready. */ function initializeOnDomReady() { - if (window.top == window.self) - chrome.extension.sendRequest({ handler: "registerFrame", frameId: frameId, top: true, total: frames.length }); - else - registerFrameIfSizeAvailable(); + registerFrameIfSizeAvailable(window.top == window.self); if (isEnabledForUrl) enterInsertModeIfElementIsFocused(); @@ -183,11 +180,11 @@ function initializeOnDomReady() { }; // This is a little hacky but sometimes the size wasn't available on domReady? -function registerFrameIfSizeAvailable () { +function registerFrameIfSizeAvailable (top) { if (innerWidth != undefined && innerWidth != 0 && innerHeight != undefined && innerHeight != 0) - chrome.extension.sendRequest({ handler: "registerFrame", frameId: frameId, area: innerWidth * innerHeight }); + chrome.extension.sendRequest({ handler: "registerFrame", frameId: frameId, area: innerWidth * innerHeight, top: top, total: frames.length + 1 }); else - setTimeout(registerFrameIfSizeAvailable, 100); + setTimeout(function () { registerFrameIfSizeAvailable(top); }, 100); } /* |
