12/26/2023 0 Comments Google chrome history location![]() ![]() If I don't want an user press back key in a page (lets say page B called from an page A) and go back to last page (page A), I do next steps:įirst, on page A, instead call next page using or, I make a call using two commands: window.open and window.close example on page A: Īll modifiers on window open are just to make up the resulting page. This is an ancient history, but may be my solution could be useful for you or another developers. Finally, we go to c.html*, and if we click the back button in the browser, we will jump to **a.html. In b.html, we use the location.replace(c.html) method to navigate from b.html to c.html. With href link, we can navigate from a.html to b.html to c.html. Var jumper = document.getElementById("jumper") This is b.html page ! Go to c.html page ! This is a.html page ! Go to b.html page ! So there is no Javascript method to clear the session history, instead, if you want to block navigating back to a certain page, you can use the location.replace() method, and pass the page link as parameter, which will not push the page to the browser's session history list. The closest available solution is the location.replace() method, which replaces the current item of the session history with the provided URL. There is no way to clear the session history or to disable the back/forward navigation from unprivileged code. For top-level pages you can see the list of pages in the session history, accessible via the History object, in the browser's dropdowns next to the back and forward buttons.įor security reasons the History object doesn't allow the non-privileged code to access the URLs of other pages in the session history, but it does allow it to navigate the session history. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |