Merge pull request #10125 from benediktwerner/DOMContentLoaded

Use DOMContentLoaded instead of window.onload
deepcrayonfish^2
Thibault Duplessis 2021-11-17 08:07:24 +01:00 committed by GitHub
commit 6efc6b4982
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -149,7 +149,7 @@ object layout {
def lichessJsObject(nonce: Nonce)(implicit lang: Lang) =
embedJsUnsafe(
s"""lichess={load:new Promise(r=>{window.onload=r}),quantity:${lila.i18n
s"""lichess={load:new Promise(r=>{document.addEventListener("DOMContentLoaded",r)}),quantity:${lila.i18n
.JsQuantity(lang)}};$timeagoLocaleScript""",
nonce
)

View File

@ -1,5 +1,5 @@
interface Lichess {
load: Promise<void>; // window.onload promise
load: Promise<void>; // document.onload promise
info: any;
requestIdleCallback(f: () => void, timeout?: number): void;
sri: string;