diff options
| author | gdh1995 | 2015-08-28 21:06:59 +0800 |
|---|---|---|
| committer | gdh1995 | 2015-08-28 21:06:59 +0800 |
| commit | 7fc38e75a63aec65b03b92acd2089fa8b0c97235 (patch) | |
| tree | 2f51465c8701f4c51986a9ad4c79b6da94d0a161 | |
| parent | 46fe5cffc952b80371f839fce0aa2fc8ded27f50 (diff) | |
| download | vimium-7fc38e75a63aec65b03b92acd2089fa8b0c97235.tar.bz2 | |
fix the bug that XML view page may change itself into RSS document
| -rw-r--r-- | content_scripts/vimium_frontend.coffee | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee index 62aa684d..3abd2abb 100644 --- a/content_scripts/vimium_frontend.coffee +++ b/content_scripts/vimium_frontend.coffee @@ -274,7 +274,7 @@ setScrollPosition = ({ scrollX, scrollY }) -> # # Called from the backend in order to change frame focus. # -window.focusThisFrame = do -> +setTimeout (-> # Create a shadow DOM wrapping the frame so the page's styles don't interfere with ours. highlightedFrameElement = DomUtils.createElement "div" # PhantomJS doesn't support createShadowRoot, so guard against its non-existance. @@ -289,7 +289,7 @@ window.focusThisFrame = do -> _frameEl.className = "vimiumReset vimiumHighlightedFrame" _shadowDOM.appendChild _frameEl - (request) -> + window.focusThisFrame = (request) -> if window.innerWidth < 3 or window.innerHeight < 3 # This frame is too small to focus. Cancel and tell the background frame to focus the next one instead. # This affects sites like Google Inbox, which have many tiny iframes. See #1317. @@ -302,6 +302,7 @@ window.focusThisFrame = do -> if shouldHighlight document.documentElement.appendChild highlightedFrameElement setTimeout (-> highlightedFrameElement.remove()), 200 +), 0 extend window, scrollToBottom: -> |
