From 5cdeb4d4ac2bc3171b47043f0275d0f8331486a6 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sun, 24 Aug 2014 12:10:28 +0100 Subject: Do not call handlers which do not exist (fixed, again). --- content_scripts/vimium_frontend.coffee | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'content_scripts') diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee index 5731838c..2bdd85a8 100644 --- a/content_scripts/vimium_frontend.coffee +++ b/content_scripts/vimium_frontend.coffee @@ -123,12 +123,13 @@ initializePreDomReady = -> currentKeyQueue: (request) -> keyQueue = request.keyQueue chrome.runtime.onMessage.addListener (request, sender, sendResponse) -> - # in the options page, we will receive requests from both content and background scripts. ignore those + # In the options page, we will receive requests from both content and background scripts. ignore those # from the former. + console.log request.name, request return if sender.tab and not sender.tab.url.startsWith 'chrome-extension://' return unless isEnabledForUrl or request.name == 'getActiveState' or request.name == 'setState' - # registerFrame requests are delivered here, but there's no handler. - return if request.handler == "registerFrame" + # These requests are delivered to the options page, but there are no handlers there. + return if request.handler == "registerFrame" or request.handler == "frameFocused" requestHandlers[request.name](request, sender) false -- cgit v1.2.3