From a9c8cb7dbdc37a8456d2a66fe39e76a02f39d301 Mon Sep 17 00:00:00 2001 From: Captain ALM Date: Sat, 30 Jul 2022 22:40:23 +0100 Subject: [PATCH] . --- index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index f184e0e..d5f1921 100644 --- a/index.js +++ b/index.js @@ -141,7 +141,11 @@ function ToggleTheme() { } function SetupJSHPL(){ if (window.history) { - if (window.history.pushState) { + if (window.history.pushState && window.history.replaceState) { + if (document.onreadystatechange) { + document.onreadystatechange = cReplaceHistory + } + document.addEventListener("DOMContentLoaded", cReplaceHistory) window.addEventListener("load", cReplaceHistory) window.addEventListener("popstate", HandleHistoryPop) }