diff options
| -rw-r--r-- | content_scripts/mode.coffee | 11 | ||||
| -rw-r--r-- | content_scripts/vimium_frontend.coffee | 3 |
2 files changed, 10 insertions, 4 deletions
diff --git a/content_scripts/mode.coffee b/content_scripts/mode.coffee index 9016caa2..7ca818b4 100644 --- a/content_scripts/mode.coffee +++ b/content_scripts/mode.coffee @@ -59,10 +59,15 @@ class Mode handlerStack.alwaysPropagate => badge.badge ||= @badge # Static method. Used externally and internally to initiate bubbling of an updateBadgeForMode event. + # Do not update the badge: + # - if this document does not have the focus, or + # - if the document's body is a frameset @updateBadge: -> - badge = {badge: ""} - handlerStack.bubbleEvent "updateBadgeForMode", badge - Mode.sendBadge badge.badge + if document.hasFocus() + unless document.body?.tagName.toLowerCase() == "frameset" + badge = {badge: ""} + handlerStack.bubbleEvent "updateBadgeForMode", badge + Mode.sendBadge badge.badge # Static utility to update the browser-popup badge. @sendBadge: (badge) -> diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee index 6d63b24a..7ce3e988 100644 --- a/content_scripts/vimium_frontend.coffee +++ b/content_scripts/vimium_frontend.coffee @@ -201,7 +201,7 @@ initializeWhenEnabled = (newPassKeys) -> # installListener document, "focus", onFocusCapturePhase # No longer needed. installListener document, "blur", onBlurCapturePhase installListener document, "DOMActivate", onDOMActivate - installListener document, "focus", onFocus + installListener document, "focusin", onFocus installListener document, "blur", onBlur enterInsertModeIfElementIsFocused() installedListeners = true @@ -281,6 +281,7 @@ window.focusThisFrame = (shouldHighlight) -> chrome.runtime.sendMessage({ handler: "nextFrame", frameId: frameId }) return window.focus() + Mode.updateBadge() if (document.body && shouldHighlight) borderWas = document.body.style.border document.body.style.border = '5px solid yellow' |
