What should be the value of the crossorigin attribute of the script tag?

If I have a script tag with the src cross domain and I want to access errors from window.onerror , I need to add the crossorigin attribute:

 <script type="text/javascript" src="otherdomain.com/foo.js" crossorigin="..."></script> 

My question is: what should the attribute value be? Does it matter? Is this value required?

I have seen several people using the value "anonymous" , but I can not find the right explanation for the reasons. This blog post mysteriously notes that this is "the safest value."

+4
source share

Source: https://habr.com/ru/post/1488626/


All Articles