简体   繁体   中英

Delete browser history

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

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.

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";

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM