ghenne
ghenne

Reputation: 1903

Detecting JavaScript errors in Chrome

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?

Upvotes: 28

Views: 53557

Answers (3)

patrickmdnet
patrickmdnet

Reputation: 3392

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

Upvotes: 25

Eli Grey
Eli Grey

Reputation: 35830

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

Upvotes: -4

rhino
rhino

Reputation: 13881

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.

Upvotes: 2

Related Questions