Hiding violations in Chrome Dev Console

做~自己de王妃 提交于 2019-11-30 11:41:43

问题


Starting a few versions ago, Google Chrome has started showing JS violations in the developer console. While that can be useful sometimes, more often it is just cluttering the console.

Is there a way to disable these violations?

As a side note, also since recently, the developer console no longer features checkboxes for the various types of debug output. Now you only have log levels: Verbose, Info, Warnings, Errors. I find the former method with checkboxes much more useful - is there some way (a flag?) to make them come back?


回答1:


In latest Chrome (64.0.3282.167), add the following to your "Filter" box with "All levels" selected:

-[Violation]

Not sure if any sort of Regex is supported any longer (previous versions of Chrome had a checkbox that allowed you to filter by expression), but the - seems to be a "don't match".




回答2:


Yes, as of Chrome 58:

  • The Hide violations checkbox is gone. Set the logging level dropdown
    to Verbose to see violations.

In the following screenshot, it is set to "Info":




回答3:


Another option:

  1. Open Console Settings (the gear icon).
  2. Check the User Messages Only checkbox to only show messages logged from scripts. Browser violations are hidden when this checkbox is enabled.

Chrome version: 62.0.3169.0 (Official Build) canary (64-bit)



来源:https://stackoverflow.com/questions/44023334/hiding-violations-in-chrome-dev-console

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!