diff options
| author | Stephen Blott | 2016-03-04 11:49:16 +0000 |
|---|---|---|
| committer | Stephen Blott | 2016-03-05 05:32:36 +0000 |
| commit | 27d3d0087c86a6effd25049cbf0d9273eb0af9db (patch) | |
| tree | 3189299e564bc632d87319df7b2160c2c10132b5 | |
| parent | b954ffdb6c94fa468eb10d0955513b876b1f1a95 (diff) | |
| download | vimium-27d3d0087c86a6effd25049cbf0d9273eb0af9db.tar.bz2 | |
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.
| -rw-r--r-- | content_scripts/vimium_frontend.coffee | 5 |
1 files changed, 3 insertions, 2 deletions
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" ] |
