This commit is contained in:
Percs 2024-07-16 17:42:21 -05:00
parent fa779017ad
commit d6dd1d4ca3
20 changed files with 363 additions and 379 deletions

View file

@ -50,7 +50,9 @@ for (const attr of attrs) {
if (["nonce", "integrity", "csp"].includes(attr)) {
return;
} else if (["src", "data", "href", "action", "formaction"].includes(attr)) {
} else if (
["src", "data", "href", "action", "formaction"].includes(attr)
) {
value = encodeUrl(value);
} else if (attr === "srcdoc") {
value = rewriteHtml(value);
@ -88,7 +90,9 @@ Element.prototype.setAttribute = new Proxy(Element.prototype.setAttribute, {
thisArg.__origattrs[argArray[0]] = argArray[1];
if (["nonce", "integrity", "csp"].includes(argArray[0])) {
return;
} else if (["src", "data", "href", "action", "formaction"].includes(argArray[0])) {
} else if (
["src", "data", "href", "action", "formaction"].includes(argArray[0])
) {
argArray[1] = encodeUrl(argArray[1]);
} else if (argArray[0] === "srcdoc") {
argArray[1] = rewriteHtml(argArray[1]);