28

Chrome does not appear to give any indication that a page has JavaScript errors, unless you open up the JavaScript Console to check.

Is there any way to have an indication that there were errors, and then automatically open the JavaScript Console? Can the JavaScript console be opened from JavaScript?

ghenne
  • 1,903
  • 2
  • 19
  • 29

3 Answers3

25

Chrome does not have a native ability to alert you to Javascript errors. However, this Chrome extension will show an alert icon in the address bar when a Javascript error occurs:

https://github.com/barbushin/javascript-errors-notifier

The extension can be installed here:

https://chrome.google.com/webstore/detail/jafmfknfnkoekkdocjiaipcnmkklaajd

barbushin
  • 5,165
  • 5
  • 37
  • 43
patrickmdnet
  • 3,332
  • 1
  • 29
  • 34
  • 2
    @Evgenii Extension does not show ads. It's 100% open source https://github.com/barbushin/javascript-errors-notifier and published version is same as on GitHub, so you can check it by yourself. – barbushin Apr 05 '16 at 07:52
  • Notice: It doesn't work if you use webpack dev-server. – Danita Apr 30 '19 at 15:24
2

I think you cannot open the console directly from your JavaScript code. And as far as I know, only Opera has the option to display the console automatically, right after any error occurs.

rhino
  • 13,543
  • 9
  • 37
  • 39
  • IE will display the console after errors. I forget offhand where the magical radio button is though. – Ben Aug 19 '13 at 00:45
-4

No. Even calling console.log will not display the console.

Eli Grey
  • 35,104
  • 14
  • 75
  • 93
  • calling console.log() can dump things in console. It will not make the console show up, so you need to open it yourself, by pressing F12 and then click console tab. – Evan Hu Aug 01 '14 at 15:57