Merge "Set crossorigin="anonymous" when load plugin js files"

This commit is contained in:
Tao Zhou 2020-03-09 07:42:53 +00:00 committed by Gerrit Code Review
commit 64a8551d90

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);
}