3 ms·
You need error reporting as a separate script injected early on into the html page before your script is ever loaded. This error reporting script should be as b
by ComputerGuru 4y ago
You need error reporting as a separate script injected early on into the html page before your script is ever loaded. This error reporting script should be as bare bones and backwards compatible as possible.
You can grab mine from our site, if you like.
- bhouston 4y agoSure. Which site is that? I can do this easily on the iframe embed.
- roqi 4y ago[flagged]
- ComputerGuru 4y agoHere you go, this is taken from production, copied from the browser's "view source" feature so there are a few dynamic values hard-coded (they're obvious, though): https://gist.github.com/mqudsi/2f570cf58d7d293ba27217a308659dfe https://gist.github.com/mqudsi/2f570cf58d7d293ba27217a308659... It's from a checkout page (the most important page where fancy JS isn't worth a single lost sale) so it goes to great pains to catch all errors and not be itself a source of JS errors. It intercepts errors and POSTs them to the server with a good-faith attempt at getting the browser, faulting script, line number, column number, error message, and stack trace. It was actually in a <script> tag and not in an external js, but that shouldn't matter too much. You can see the comments and code to support actually ancient browsers (predating IE6 and Firefox 24).