script.js icon indicating copy to clipboard operation
script.js copied to clipboard

Allow option to set crossorigin attribute on script tags

Open kaareal opened this issue 13 years ago • 6 comments

To access the error message on window.onerror when loading js files from a different domain, the crossorigin attribute has to be set on the script tags (+ headers "Access-Control-Allow-Origin" on the cdn naturally).

This only works in ff, but i think its coming in chrome soon as well.

kaareal avatar Jul 25 '12 10:07 kaareal

i think i'll hold shortly on this until support is more widely adopted

ded avatar Jul 27 '12 03:07 ded

crossorigin script attribute is available in chrome 30m, which is the current stable release: https://code.google.com/p/chromium/issues/detail?id=159566

bhouston avatar Oct 25 '13 20:10 bhouston

see also https://github.com/jrburke/requirejs/issues/687

kaareal avatar Mar 20 '14 22:03 kaareal

:+1: for this one... Without this option, it's impossible to use tools like Bugsnag or Newrelic Browser to debug JavaScript errors.

gil avatar Sep 08 '15 18:09 gil

Agreed. Impossible to use raygun.io as well.

charleskoehl avatar Jan 18 '16 07:01 charleskoehl

I need this for Bugsnag as well. @ded If you're buying in, I could try to find time to make a PR.

flushentitypacket avatar Jun 30 '16 16:06 flushentitypacket