Simplest method is deleting the page from history (and, if the URL is not in the history, adding it to history by visiting it and then deleting), as explained in the accepted answer. However, OP also asked about scripting the process without going to history, and this is indeed possible to do.
Chromium uses the Visited Links
file in the profile path for the visited status of links. This file is in binary format, unlike the History
and other files which are SQLite databases. However, as Chromium is open source, we don't need to reverse engineer it.
The file starts with the header VLnk
and contains the 8-byte fingerprints for the URLs that have been visited. The fingerprint is the first 8 bytes of the MD5 hash of the salt + URL. Salt is located at the 0x10 offset in the file.
To unvisit a link in a Chromium browser you can calculate the fingerprint of the URL for your profile, find it in the Visited Links
file, zero those 8 bytes and also decrement the counter at the beginning of the file (you can see it by comparing the files from before and after visiting a new link). This is what Chromium does when an item is manually deleted from history, and clearing all history zeroes the whole file. Chromium browsers may keep history (stored in the History
file) for a limited time, e.g. Chrome apparently keeps them for 90 days. Presumably, after those 90 days, they are removed from History
but not Visited Links
, which explains the discrepancy between the two mentioned in the accepted answer.
Here is some Python code to better understand the content of Visited Links
file from a Chromium forensic tool. You can first use the chromagnonVisitedLinks.py
to check it works, and then modify the visitedLinks.py
to not just find but delete URLs.