diff options
| author | Stephen Blott | 2014-10-26 06:32:37 +0000 |
|---|---|---|
| committer | Stephen Blott | 2014-10-26 06:32:37 +0000 |
| commit | e8f2fb67dfec05a7cc87b69e612a8d38734ef7cf (patch) | |
| tree | 8452abf192616f353e52d23ffc72c566dd26851c | |
| parent | a485fe7500ce0d8cad0b6f5a3d20b279d738521b (diff) | |
| parent | 17d06058b8aa5e05a705c5c914fb42bf9f13a307 (diff) | |
| download | vimium-e8f2fb67dfec05a7cc87b69e612a8d38734ef7cf.tar.bz2 | |
Merge branch 'mrmr1993-stop-frame-register-infinite-loop'
| -rw-r--r-- | background_scripts/main.coffee | 2 | ||||
| -rw-r--r-- | content_scripts/vimium_frontend.coffee | 19 |
2 files changed, 8 insertions, 13 deletions
diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee index 352cfa48..7b9d98b0 100644 --- a/background_scripts/main.coffee +++ b/background_scripts/main.coffee @@ -593,7 +593,7 @@ registerFrame = (request, sender) -> focusedFrame = request.frameId framesForTab[sender.tab.id].total = request.total - framesForTab[sender.tab.id].frames.push({ id: request.frameId, area: request.area }) + framesForTab[sender.tab.id].frames.push({ id: request.frameId }) handleFrameFocused = (request, sender) -> focusedFrame = request.frameId diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee index 6db0d830..317acd22 100644 --- a/content_scripts/vimium_frontend.coffee +++ b/content_scripts/vimium_frontend.coffee @@ -174,24 +174,19 @@ window.addEventListener "focus", -> # Initialization tasks that must wait for the document to be ready. # initializeOnDomReady = -> - registerFrameIfSizeAvailable(window.top == window.self) + registerFrame(window.top == window.self) enterInsertModeIfElementIsFocused() if isEnabledForUrl # Tell the background page we're in the dom ready state. chrome.runtime.connect({ name: "domReady" }) -# This is a little hacky but sometimes the size wasn't available on domReady? -registerFrameIfSizeAvailable = (is_top) -> - if (innerWidth != undefined && innerWidth != 0 && innerHeight != undefined && innerHeight != 0) - chrome.runtime.sendMessage( - handler: "registerFrame" - frameId: frameId - area: innerWidth * innerHeight - is_top: is_top - total: frames.length + 1) - else - setTimeout((-> registerFrameIfSizeAvailable(is_top)), 100) +registerFrame = (is_top) -> + chrome.runtime.sendMessage( + handler: "registerFrame" + frameId: frameId + is_top: is_top + total: frames.length + 1) # # Enters insert mode if the currently focused element in the DOM is focusable. |
