From b05276ed8264e5a71f20a7068690ba2a414ee6d8 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sat, 7 Mar 2015 16:49:32 +0000 Subject: Reload content scripts after install/update. This is @mrmr1993's work from #1041. Reload content scripts when vimium is installed or updates. (@mrmr1993: The automatic merge was really messy (or, at least, I couldn't figure out what was going on). Since the bulk of #1041 was actually quite compact, I took the liberty of just copying it in. Hope you don't mind.) --- content_scripts/vimium_frontend.coffee | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'content_scripts') diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee index b2d9f735..66922084 100644 --- a/content_scripts/vimium_frontend.coffee +++ b/content_scripts/vimium_frontend.coffee @@ -210,6 +210,7 @@ window.initializeWhenEnabled = -> for type in [ "keydown", "keypress", "keyup", "click", "focus", "blur", "mousedown" ] do (type) -> installListener window, type, (event) -> handlerStack.bubbleEvent type, event installListener document, "DOMActivate", (event) -> handlerStack.bubbleEvent 'DOMActivate', event + installListener document, "focus", detectFocus installedListeners = true FindModeHistory.init() @@ -229,7 +230,7 @@ getActiveState = -> # # The backend needs to know which frame has focus. # -window.addEventListener "focus", -> +detectFocus = -> # settings may have changed since the frame last had focus settings.load() chrome.runtime.sendMessage({ handler: "frameFocused", frameId: frameId }) -- cgit v1.2.3