aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgdh19952015-08-28 21:06:59 +0800
committergdh19952015-08-28 21:06:59 +0800
commit7fc38e75a63aec65b03b92acd2089fa8b0c97235 (patch)
tree2f51465c8701f4c51986a9ad4c79b6da94d0a161
parent46fe5cffc952b80371f839fce0aa2fc8ded27f50 (diff)
downloadvimium-7fc38e75a63aec65b03b92acd2089fa8b0c97235.tar.bz2
fix the bug that XML view page may change itself into RSS document
-rw-r--r--content_scripts/vimium_frontend.coffee5
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: ->