From 27d3d0087c86a6effd25049cbf0d9273eb0af9db Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Fri, 4 Mar 2016 11:49:16 +0000 Subject: Improved test for messages intended for background page. The options page receives messages intended for the background page (and we're getting console warnings). This is a more general test for when the front end should ignore such messages. Fixes #2034. --- content_scripts/vimium_frontend.coffee | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'content_scripts') diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee index aab92a85..667031dc 100644 --- a/content_scripts/vimium_frontend.coffee +++ b/content_scripts/vimium_frontend.coffee @@ -154,8 +154,9 @@ initializePreDomReady = -> # In the options page, we will receive requests from both content and background scripts. ignore those # from the former. return if sender.tab and not sender.tab.url.startsWith 'chrome-extension://' - # These requests are delivered to the options page, but there are no handlers there. - return if request.handler in [ "registerFrame", "frameFocused", "unregisterFrame", "setIcon" ] + # These requests are intended for the background page, but are delivered to the options page too, where + # there are no handlers. + return if request.handler and not request.name shouldHandleRequest = isEnabledForUrl # We always handle the message if it's one of these listed message types. shouldHandleRequest ||= request.name in [ "executePageCommand", "checkEnabledAfterURLChange" ] -- cgit v1.2.3