Created
December 30, 2021 08:09
-
-
Save yilmazdurmaz/01e4d205bf3d5b95c03f0bb8dfaee18b to your computer and use it in GitHub Desktop.
clear browser history in history page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// open history page of the browser | |
// open dev tools and get to console | |
// set sleep function and the use for loop | |
// change "getelements..." queries if needed | |
// note that it is not intended to clear thing other than history | |
// sleep function from https://stackoverflow.com/a/951057/9512475 | |
// sleep time expects milliseconds | |
function sleep (time) { | |
return new Promise((resolve) => setTimeout(resolve, time)); | |
} | |
// Usage! | |
sleep(500).then(() => { | |
// Do something after the sleep! | |
}) | |
// deletion is not automated. | |
// history page store only around 10 elements at time. | |
// and this can delete up to 100 entries at a time | |
// so repeat the command until history is clear | |
for(x=0;x<10;x++){ | |
sleep(x*250).then(()=>{ | |
for(i=10;i>0;i--){ | |
document.getElementsByTagName("input")[i].click(); | |
} | |
document.getElementById("actionDialogCardPrimaryButton").click(); | |
document.getElementById("confirmModalPrimaryButton").click(); | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment