79645270

Date: 2025-05-30 10:13:39
Score: 1
Natty:
Report link

Solve the issue by checking if the url is having string "handler=" , if yes then replaced that with the page name in the history state . So when user clicks back he will be automatically getting the Page name without the handler

Code

         window.addEventListener("load", function () {
    if (window.location.search.includes("handler=")) {
        history.replaceState({}, document.title, window.location.pathname);
    }
});
Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Yuvraj Jadhav