Coview platform has built-in functionality for monitoring and tracking down errors originating in your customer's browser. Usually, browsers happily report any errors - except when the offending code is served from a CDN or a different domain. In that case, all that you get is a meaningless
Script error on line 0 message instead of a stack trace and a description.
To unlock error reporting for cross-origin scripts, you will need to enable CORS support. This will let you bypass the same-origin policy in a secure way and allow Coview to capture error data coming from other third-party scripts as well.
Enabling CORS on your website is straightforward and involves two steps described below.
Attach the following HTTP header to the response containing your script files:
Script tags have an attribute called
crossorigin which allows to pass error data to a
window.onerror callback. Define it on applicable script tags with a value set to
<script src="https://example.com/example-framework.js" crossorigin="anonymous" ></script>
Updated almost 3 years ago