This commit is contained in:
Kyle Carberry 2019-03-15 00:51:05 -04:00
parent 400fba7f6f
commit 2f27b5df8c
No known key found for this signature in database
GPG Key ID: A0409BDB6B0B3EDB
1 changed files with 6 additions and 2 deletions

View File

@ -46,7 +46,9 @@ const newCreateElement = <K extends keyof HTMLElementTagNameMap>(tagName: K): HT
return oldSrc!.get!.call(img);
},
set: (value: string): void => {
value = value.replace(/file:\/\//g, "/resource");
if (value) {
value = value.replace(/file:\/\//g, "/resource");
}
oldSrc!.set!.call(img, value);
},
});
@ -65,7 +67,9 @@ const newCreateElement = <K extends keyof HTMLElementTagNameMap>(tagName: K): HT
return oldInnerHtml!.get!.call(style);
},
set: (value: string): void => {
value = value.replace(/file:\/\//g, "/resource");
if (value) {
value = value.replace(/file:\/\//g, "/resource");
}
oldInnerHtml!.set!.call(style, value);
},
});