diff --git a/assets/js/academic-search.js b/assets/js/academic-search.js index d4a84ae1..4b262c3e 100644 --- a/assets/js/academic-search.js +++ b/assets/js/academic-search.js @@ -43,8 +43,8 @@ function getSearchQuery(name) { // Set query in URI without reloading the page. function updateURL(url) { - if (history.pushState) { - window.history.pushState({path:url}, '', url); + if (history.replaceState) { + window.history.replaceState({path:url}, '', url); } } diff --git a/assets/js/academic.js b/assets/js/academic.js index 992adc6a..f144a830 100644 --- a/assets/js/academic.js +++ b/assets/js/academic.js @@ -50,9 +50,9 @@ } function removeQueryParamsFromUrl() { - if (window.history.pushState) { + if (window.history.replaceState) { let urlWithoutSearchParams = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.hash; - window.history.pushState({path:urlWithoutSearchParams}, '', urlWithoutSearchParams); + window.history.replaceState({path:urlWithoutSearchParams}, '', urlWithoutSearchParams); } }