Set crossorigin="anonymous" when load plugin js files

This will help provide more meaningful error other than `Script error.`

Change-Id: Ie1ae6bb96e5ca61c390f7b125788d1975fcd5823
This commit is contained in:
Tao Zhou
2020-03-08 22:03:33 +01:00
parent 91442beceb
commit ae80111061

View File

@@ -359,6 +359,10 @@
const el = document.createElement('script');
el.defer = true;
el.setAttribute('src', url);
// no credentials to send when fetch plugin js
// and this will help provide more meaningful error than
// 'Script error.'
el.setAttribute('crossorigin', 'anonymous');
el.onerror = onerror;
return document.body.appendChild(el);
}