Safari favicons mess

I have been playing with Safari's favicon on my 2014 MacBook Pro (running Catalina) for a couple of days, replacing ugly or non existent icons of my bookmarks (mainly using this).

All of a sudden the database file and all the icons' images in /Users/(me)/Library/Safari/Touch Icons Cache got somehow locked.

The images in particular I cannot unlock or delete, even as root, even in recovery mode.

If I try to replace an icon, a new weird file show up in .../Touch Icons Cache/Images and I cannot erase it. The icon to be replaced has not changed or has become the new one only at the first launch of Safari.

I would like to continue to replace ugly icons of my bookmarks and I also would like to solve this locked folder mystery.


I managed to solve the problem by deleting the whole Touch Icons Cache folder. I then replaced manually the icons.

If I try to use the safari-favicons.sh code the problem shows up again. I guess I'll adapt.