diff --git a/src/assets/javascripts/index.ts b/src/assets/javascripts/index.ts index 4b00dab57..9ca54cfa2 100644 --- a/src/assets/javascripts/index.ts +++ b/src/assets/javascripts/index.ts @@ -46,7 +46,8 @@ import { observeOn, take, shareReplay, - share + share, + skip } from "rxjs/operators" import { @@ -347,7 +348,7 @@ export function initialize(config: unknown) { /* Resolve relative links for stability */ for (const selector of [ `link[rel="shortcut icon"]`, - `link[rel="stylesheet"]` + // `link[rel="stylesheet"]` // reduce style computations ]) for (const el of getElements(selector)) el.href = el.href diff --git a/src/assets/javascripts/patches/script/index.ts b/src/assets/javascripts/patches/script/index.ts index a9cb30219..5f53cce41 100644 --- a/src/assets/javascripts/patches/script/index.ts +++ b/src/assets/javascripts/patches/script/index.ts @@ -64,8 +64,8 @@ export function patchScripts( for (const el of els) { if (el.src || /(^|\/javascript)$/i.test(el.type)) { const script = document.createElement("script") - const key = el.src ? "src" : "innerText" - script[key] = el[key] + const key = el.src ? "src" : "textContent" + script[key] = el[key]! el.replaceWith(script) } } diff --git a/src/assets/javascripts/utilities/string/index.ts b/src/assets/javascripts/utilities/string/index.ts index c52a08f89..9ac066aad 100644 --- a/src/assets/javascripts/utilities/string/index.ts +++ b/src/assets/javascripts/utilities/string/index.ts @@ -64,7 +64,7 @@ let lang: Record export function translate(key: TranslateKey, value?: string): string { if (typeof lang === "undefined") { const el = getElementOrThrow("#__lang") - lang = JSON.parse(el.innerText) + lang = JSON.parse(el.textContent!) } if (typeof lang[key] === "undefined") { throw new ReferenceError(`Invalid translation: ${key}`)