add no-cors

This commit is contained in:
hippoz 2020-10-04 22:54:10 +03:00
parent 82e338147e
commit f94b3cf6e3

View file

@ -46,7 +46,9 @@ A._Collection.prototype.html = function (html) {
};
A._Collection.prototype.load = async function (url) {
const res = await fetch(url);
const res = await fetch(url, {
mode: 'no-cors'
});
if (!res.ok) {
console.error(`load(${url}) failed with code ${res.status}`);
return;