Search code examples
firefoxsuppress-warningsfirefox-developer-tools

Firefox: how to disable Firefox developer warnings in console?


While developing websites, Firefox insist on spamming the developer console over and over with increasingly inane warning, like this one:

enter image description here

This is a perfect example of warning that cannot be fixed, as I'm using relative positioning on purpose.

These warnings make it harder to see problems in my code that I actually want to see. How do I disable or hide them completely?


Solution

  • The Console doesn't provide a way for filtering specific messages yet (as of Firefox 96.0). This feature is requested in https://bugzil.la/1255311.

    What's currently possible regarding filtering the messages is described in the documentation for the DevTools Console.

    Having said that, there are a few ways to hide those messages though they also have some downsides.

    Hide all messages of that type

    You can hide all messages of a specific type (in this case warnings) by clicking the related filter button in the Console's toolbar.

    Filter buttons for console messages

    This also means that all other possibly relevant messages of that type are hidden.

    Do a negative search

    In the filter field of the Console you can perform a search to exclude all messages that contain the entered phrases.

    For you example you could enter "-relative positioning" (without the quotes) to filter out this specific message.

    Negative filtering within the Console

    This works fine for the current tab. Though the filter is not saved permanently. That means you have to enter it whenever you open the DevTools to filter out the messages. And it also hinders you to do a normal filtering search.