Use the Chrome Devtools Console Filter to hide console errors caused by extensions

46

7

I would like to remove all the ERR_BLOCKED_BY_CLIENT errors I get due to AdBlock, so I thought the Filter field would be appripriate but I can't use it to reverse filter.

enter image description here

Basically what I want is ... | grep -v ERR_BLOCKED_BY_CLIENT

Dorian

Posted 2014-04-03T16:24:26.657

Reputation: 1 191

For anyone looking for an answer, please go to chrome bug tracker and let the chrome dev team know we need this: https://bugs.chromium.org/p/chromium/issues/detail?id=239401

– pootzko – 2017-10-05T16:00:01.233

Answers

46

Nowadays Chrome has an exclusion mechanism in its filter box:

-net::ERR_BLOCKED_BY_CLIENT

This removes all console errors that block access to network resources. These errors are usually caused by ad blockers and similar scripts. But watch out, this can also be caused by service workers on your own site.

As a more thorough solution, you might want to block the output generated by all extensions. This also leaves less chance for false positives.

Located at the top-right corner of the console there's a cog wheel to manage console settings. The option Selected context only ignores all of the nested browser extension contexts. Below some example screenshots.

Settings with Selected context only disabled:

Settings with "Selected context only" disabled

Settings with Selected context only enabled:

Settings with "Selected context only" enabled

Guido Bouman

Posted 2014-04-03T16:24:26.657

Reputation: 576

(?!.*BLOCKED_BY_CLIENT) is sufficient (for the superlazyuser). – Scott Weaver – 2017-01-20T19:33:01.303

No, it doesn't. Did you turn on regex? And did you check other output not being deleted as well? Your solution filters out all console output when regex is disabled, and filters nothing when regex is enabled. – Guido Bouman – 2017-01-24T10:29:50.900

7Chrome changed the way this works, you'll need to surround the regex with forward slashes: /^(?!net::ERR_BLOCKED_BY_CLIENT).*$/ – camomileCase – 2017-10-06T21:03:10.650

how do I hide the following message Unchecked runtime.lastError: Could not establish connection. Receiving end does not exist. – aeid – 2018-11-24T10:26:17.490

That looks like an error from a specific website. Just filtering the error doesn't seem like a great idea. If you're really sure you want to filter that, you could do this: /^(?!lastError: Could not establish connection\. Receiving end does not exist\.).*$/ – Guido Bouman – 2018-11-26T09:47:27.770

This doesn't work for me on Chromium 72. Filtering is applied only right after typing the rule, but after a refresh/navigation it's no longer effective. Bug? Ideas? – Ronan Jouchet – 2019-02-07T15:59:14.460

It seems Chrome has removed this functionality. As a work-around you can enable "Selected context only" to disable all logging bij extensions. This option can be found under the settings cog in the console. – Guido Bouman – 2019-02-11T15:14:48.337

30

Mac Pro (Retina, 13-inch, Early 2013) OSX: 10.10.5 Chrome: 46.0.2490.71 (64-bit)

  1. Open 'Console' and right click on the Error log you do not want to see.
  2. Click on 'Filter'-> 'Hide message from xxx.js'

Screenshot
(Click image to enlarge)

Jack Lee

Posted 2014-04-03T16:24:26.657

Reputation: 401

Also working nicely on Windows. – Stijn Geukens – 2016-11-22T09:41:47.657

1but fails with source maps (all messages are from one huge vendor.js) – oluckyman – 2017-01-16T19:07:48.270

1How do you cancel that? I believe I just clicked it by mistake and I don't see any filter enabled. => Ok, found it, gotta click on another message -> filter -> unhide all – Vadorequest – 2018-03-20T18:11:29.957

Cannot find "unhide all" on the last Chrome version... – Emaborsa – 2018-10-10T13:30:26.647

4

I found that right-clicking on each message allows to hide it, but this doesn't work for scripts with autogenerated file names.

right click in dev console to hide a script

Edit: There is a "hide network messages" option now (the gods of Google Chrome answered our prayers :D):

Before:

Before

After:

After

Dorian

Posted 2014-04-03T16:24:26.657

Reputation: 1 191

Thing to note is that the "hide network messages" solution does filter out ALL network messages, including failed API calls on your own site. Which makes debugging quite hard. – Guido Bouman – 2017-01-24T10:32:54.710

Am I crazy, or did the ability to do this go away in the latest version of Chrome? – Jason – 2014-06-11T00:51:01.407

Still here in Chrome 35 – Dorian – 2014-06-11T19:18:16.647

I'm on Mac. Maybe that's a difference? – Jason – 2014-06-11T19:20:03.017

I'm on Mac too ;) – Dorian – 2014-06-11T19:28:52.443

3Looks like I'm crazy. Weird. When I right click all I get is the "Unhide All" option greyed out. No list of files. – Jason – 2014-06-11T20:28:15.680

You have to right click on a particular error message to hide errors from the script that generated it (yeah weird for me too) – Dorian – 2014-06-11T21:32:59.870

2

While it is less specific, I find that I can click the gear icon and check the "Hide Network" checkbox. What's more, this setting persists for new instances of the console and across restarts. Filters do not.

So while the filter is good if you just want to shut it off temporarily, this option removes these errors by default.

trlkly

Posted 2014-04-03T16:24:26.657

Reputation: 1 236

0

You cannot filter out console errors (in red) using the filter option.

Your best option is to either wait for an update of the extension which solves the problem, or find an alternative extension that does the same thing, or manually download the extension, unpack it, change the code that causes the error, then pack it back and install it.

Recent versions of Chrome seem to have reverse filter as mentioned in Guido Bouman's answer.

Chirag Bhatia - chirag64

Posted 2014-04-03T16:24:26.657

Reputation: 931

Thanks I guess I will just wait, I found that right clicking on each error message can allow me to "hide" them, but most of the files are analytics files (blocked by AdBlock) and the file names are auto generated but this method works for only a few analytics providers. – Dorian – 2014-04-20T00:48:13.957

0

Same thing for me(( Chrome version 36, Windows 8 clicked exactly on a log message many times

Олег Всильдеревьев

Posted 2014-04-03T16:24:26.657

Reputation: 169