Search code examples
google-chromegoogle-chrome-devtools

How to hide extension logs in the console of Chrome developer tools?


The console in my Chrome DevTools is full of junk. From what I see these are logs from Chrome extensions, and I'd like them to go away. It's very annoying because I have to clear the console output after every refresh before I start debugging. I couldn't find anything on Google, so if anyone knows how to prevent extensions' logs appearing in there please let me know.

This is what it looks like on StackOverflow:

screenshot of browser DevTools console


Solution

  • There is not easy way to disable just loggig of extensions. You can disable extensions easily and get rid of their logging.

    But if in your case you want to "ignore" extensions logs you can make your own logs more visible by using new"%c"styling command in console.

    Add this function to top of your code to make your logs bold and big and make it easy to ignore extensions logs.

    var _log = console.log;
    console.log = function() {
      _log.call(console, '%c' + [].slice.call(arguments).join(' '), 'font-weight:bold; font-size: 16px');
    };
    

    Note that this feuture is just introduced and you will need Chrome Canary to use it.

    enter image description here