Filter the Chrome console messages
You can negate filters by prepending with -
. For example, -JQMIGRATE
will exclude messages containing the string "JQMIGRATE".
Regex filters can also be negated this way. e.g. -/^DevTools/
will exclude messages that begin with "DevTools".
(Credit goes to Donald Duck, who suggested this in a comment on the chosen answer. I thought it was a far cleaner solution than negative lookaheads, and deserved to be elevated to a top-level answer.)
I think you can. Recent chrome versions allow filtering using regular expressions by enclosing the search pattern in /.../
, previous versions had a checkbox. You can express, for instance, "not bar" by using negative lookaheads, as described here How to negate specific word in regex?
In the picture below, I tried filtering for "not bar".
I've found this to simple filter all console messages from extensions. This will also persist until you clear the filter. Type -chrome-extension:
. This will REMOVE any messages that come from -> chrome-extension:
<- urls.
You can use multiple filters by putting a space between each query. Ex. -chrome-extension: -cookie
. Notice the space after the :
and before the -c
. This will REMOVE any messages that come from -> chrome-extension:
<- urls and also REMOVE any messages with cookie
in the context.
Using Chrome Version 80.0.3987.132 (Official Build) (64-bit)
The accepted answer works for single line filtering, but I found it also filters out any multi-line logs. See the following examples.
No filter:
Accepted answer (missing multi-line logs):
Fixed negative filter (correctly keeps multi-line logs):
/^((.|\s)(?!Violation))+$/
Bonus! Easy filtering out multiple matches:
/^((.|\s)(?!Violation|creating))+$/