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!
JavaScript on a page runs with the privileges of that origin. One altered library, tag manager, or snippet can read inputs, change what people see, and call your APIs as the user.
Security insights from Cside