Vikas Ambhure
Vikas Ambhure

Reputation: 1

Delete browser history

How to delete browser history? Is there any solution, using JavaScript or anything else?

Upvotes: 0

Views: 1299

Answers (2)

Arjun
Arjun

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

sleske
sleske

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

Related Questions