aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--content_scripts/vimium_frontend.coffee6
1 files changed, 5 insertions, 1 deletions
diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee
index 72be5510..0ae3d229 100644
--- a/content_scripts/vimium_frontend.coffee
+++ b/content_scripts/vimium_frontend.coffee
@@ -214,7 +214,11 @@ window.addEventListener "hashchange", onFocus
#
initializeOnDomReady = ->
# Tell the background page we're in the dom ready state.
- chrome.runtime.connect({ name: "domReady" })
+ chrome.runtime.connect(name: "domReady").onDisconnect.addListener ->
+ # We disable content scripts when we lose contact with the background page.
+ isEnabledForUrl = false
+ chrome.runtime.sendMessage = ->
+ window.removeEventListener "focus", onFocus
# We only initialize the vomnibar in the tab's main frame, because it's only ever opened there.
Vomnibar.init() if DomUtils.isTopFrame()
HUD.init()