Is there a way to black filter the messages in the Chrome console?
By example, I don't want to see messages from/containing the JQMIGRATE...
Is there a way to black filter the messages in the Chrome console?
By example, I don't want to see messages from/containing the JQMIGRATE...
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'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))+$/