fix: trustedTypes issue

- Close #2339
This commit is contained in:
JellyBrick
2024-10-16 20:40:35 +09:00
parent 11b11ed966
commit 9bc42f836f
5 changed files with 9 additions and 5 deletions

View File

@ -269,7 +269,8 @@ const defineYTMDTransElements = () => {
const that = this as HTMLElement;
const key = that.getAttribute('key');
if (key) {
that.innerHTML = i18t(key);
const targetHtml = i18t(key);
that.innerHTML = window.trustedTypes?.defaultPolicy ? window.trustedTypes.defaultPolicy.createHTML(targetHtml) : targetHtml;
}
};
customElements.define(