Reputation: 1
How to delete browser history? Is there any solution, using JavaScript or anything else?
Upvotes: 0
Views: 1299
Reputation: 1952
When you go back to the first page in the back button history and then change the url to your desired page, then the browser history gets cleared. This can be achieved with following piece of code.
window.history.go(-(window.history.length-1));
window.location.href="http://newUrl";
Upvotes: 1
Reputation: 83645
No, this is definitely not possible from JavaScript, as it would be a big security hole - any website you visit could delete your history.
You can do it from the browser UI, or by using a browser plugin, but that depends on the browser.
Maybe you can explain what your problem is, then we may be able to help better.
Upvotes: 1