I'm researching the possibility of automated on-page error detection via Javascript. I have found several questions where the answer allows you to catch Javascript compilation and runtime errors globally via window.onerror
, but no answers mention other types of non-Javascript errors that are often reported in browser error consoles. I'm primarily interested in network errors (invalid URI's, SSL errors, HTTP errors, timeouts) and resource interpretation errors (mismatching types resulting in aborting the interpretation of the resource, parsing errors on loaded resources, etc).
I checked the performance.getEntries
method, but I'm baffled to find that it does not seem to contain network requests that resulted in errors (I checked only in Chrome 29...)
I don't need full cross browser compatibility.. as long as it works on some browsers, and doesn't break the others, that's fine.
performance.getEntries()
does seem to return network requests that failed, but there is nothing to distinguish them from network requests that succeeded. (See this issue) – Zeralda