validate folder names, handle missing files more gracefully

This commit is contained in:
Shaun Walker
2020-05-12 13:24:51 -04:00
parent c83496d814
commit 6f3fe8d933
7 changed files with 99 additions and 30 deletions

View File

@ -81,14 +81,26 @@ window.interop = {
if (link.href !== url) {
link.setAttribute('href', url);
}
if (type !== "" && link.type !== type) {
link.setAttribute('type', type);
if (type !== "") {
if (link.type !== type) {
link.setAttribute('type', type);
}
} else {
link.removeAttribute('type');
}
if (integrity !== "" && link.integrity !== integrity) {
link.setAttribute('integrity', integrity);
if (integrity !== "") {
if (link.integrity !== integrity) {
link.setAttribute('integrity', integrity);
}
} else {
link.removeAttribute('integrity');
}
if (crossorigin !== "" && link.crossOrigin !== crossorigin) {
link.setAttribute('crossorigin', crossorigin);
if (crossorigin !== "") {
if (link.crossOrigin !== crossorigin) {
link.setAttribute('crossorigin', crossorigin);
}
} else {
link.removeAttribute('crossorigin');
}
}
},
@ -126,11 +138,19 @@ window.interop = {
if (script.src !== src) {
script.src = src;
}
if (integrity !== "" && script.integrity !== integrity) {
script.setAttribute('integrity', integrity);
if (integrity !== "") {
if (script.integrity !== integrity) {
script.setAttribute('integrity', integrity);
}
} else {
script.removeAttribute('integrity');
}
if (crossorigin !== "" && script.crossorigin !== crossorigin) {
script.setAttribute('crossorigin', crossorigin);
if (crossorigin !== "") {
if (script.crossOrigin !== crossorigin) {
script.setAttribute('crossorigin', crossorigin);
}
} else {
script.removeAttribute('crossorigin');
}
}
else {