Merge pull request #10125 from benediktwerner/DOMContentLoaded
Use DOMContentLoaded instead of window.onloaddeepcrayonfish^2
commit
6efc6b4982
|
@ -149,7 +149,7 @@ object layout {
|
||||||
|
|
||||||
def lichessJsObject(nonce: Nonce)(implicit lang: Lang) =
|
def lichessJsObject(nonce: Nonce)(implicit lang: Lang) =
|
||||||
embedJsUnsafe(
|
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""",
|
.JsQuantity(lang)}};$timeagoLocaleScript""",
|
||||||
nonce
|
nonce
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
interface Lichess {
|
interface Lichess {
|
||||||
load: Promise<void>; // window.onload promise
|
load: Promise<void>; // document.onload promise
|
||||||
info: any;
|
info: any;
|
||||||
requestIdleCallback(f: () => void, timeout?: number): void;
|
requestIdleCallback(f: () => void, timeout?: number): void;
|
||||||
sri: string;
|
sri: string;
|
||||||
|
|
Loading…
Reference in New Issue