Is it possible to get notified for every error logged in the console using JavaScript? -


i know can register callback javascript errors, this:

window.onerror = function(message, url, line) {     // ... }; 

however, i'd notified of other error that's being logged console, such images couldn't loaded (http status code 404) or other http request bad status code such 500.

is possible, , if yes, how? note intend use debugging purposes, doesn't matter if solution works in chrome.

it possible intercept calls console.log, javascript's flexibility :

var oldconsolelog = console.log;  console.log = function (x) {     oldconsolelog.call(console, x);     alert(' message printed console ' + x) ; } 

obviously, alerting annoying, can change alert whatever callback or event raising of like.


Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -