damn.dog icon indicating copy to clipboard operation
damn.dog copied to clipboard

iOS Chrome "Script error."

Open AhoyLemon opened this issue 5 years ago • 1 comments

This shows up a lot in @trackjs

image

It's specific to iOS Chrome

AhoyLemon avatar Oct 16 '18 17:10 AhoyLemon

trackJS offers the following...

Script Error

If your page loads scripts from different domains, you might see a lot of Script Error messages. These unhelpful messages occur because the browser's same-origin security policy is preventing the error information from one domain (hosting scripts) from leaking to another (your page). There are three ways to solve this:

Cross-Origin Resource Sharing

Modern browsers (latest Chrome and Firefox) will honor the CORS headers when chosing whether to expose error information between domains. The hosting server must have CORS Headers enabled. Then, when including the script tag, add the crossorigin attribute to the tag.

<script src="//hosted.com/path/to/script" crossorigin="anonymous"></script> Check out this blog post for more information about CORS scripts.

AhoyLemon avatar Oct 16 '18 17:10 AhoyLemon