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) }