From 339f37fb5c19f5129c7757294d8c5968be9c9db2 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Tue, 4 Sep 2018 13:16:26 +0100 Subject: Use function directly. If Vimium becomes disabled, then we remove this listener. So we better add the actual function we want to (later) remove, rather than creating a new function (which will never be removed. --- content_scripts/vimium_frontend.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee index 6fa118cf..ff27c8a4 100644 --- a/content_scripts/vimium_frontend.coffee +++ b/content_scripts/vimium_frontend.coffee @@ -176,7 +176,7 @@ onFocus = forTrusted (event) -> # We install these listeners directly (that is, we don't use installListener) because we still need to receive # events when Vimium is not enabled. window.addEventListener "focus", onFocus -window.addEventListener "hashchange", -> checkEnabledAfterURLChange() +window.addEventListener "hashchange", checkEnabledAfterURLChange initializeOnDomReady = -> # Tell the background page we're in the domReady state. -- cgit v1.2.3