Getting the window.onerror message from javascript hosted on a cdn (ff 13+)
When we move all our js scripts to cloudfront, we lost all window.onerror messages, because of the browsers same domain policy.
After doing some digging it turns out if you set the this header on the cdn Access-Control-Allow-Origin : * and add this attribute to your script tag crossorigin. You can make firefox return the full error.
But keep in mind if you set the header with the wrong domain, the crossorigin attribute will make your scripts unload-able.
webkit fix should also be on the way by the way
https://bugs.webkit.org/show_bug.cgi?id=70574
Written by Kaare
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Javascript
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#