This question is all about enabling browser back button after disabling it.
My requirement is to disable the browser back button for particular page on some condition. And I need to again enable it for other pages or for same page for other conditions. E.g. When user comes from page1 to page2, back button on page2 will be disables. Once user performs some specific opration on page2 than it will be enabled.
I have disabled browser back button by using bellow JavaScript code.
history.pushState(null, null, document.URL);
Now I have to enable it back for other pages (Even on same page after performing some specific operation).
There is so many stackoverflow questions and answers for disabling it. But I didn't find any questions for enabling it back.