Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 530
ghenne Avatar asked Aug 29 '10 15:08

ghenne


People also ask

Why is my JavaScript not working on Chrome?

Google ChromeIn the "Settings" section click on the "Show advanced settings..." Under the the "Privacy" click on the "Content settings...". When the dialog window opens, look for the "JavaScript" section and select "Allow all sites to run JavaScript (recommended)". Click on the "OK" button to close it.


2 Answers

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

like image 164
patrickmdnet Avatar answered Sep 29 '22 04:09

patrickmdnet


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.

like image 42
rhino Avatar answered Sep 29 '22 02:09

rhino