Do I even need /favicon.ico
for http://localhost
or Electron?
Right now? I use 1px PNG (not ICO) at /f/favicon.png
(not at /
, but at /f/
). I think it is at least better than using a a short string of data URI (where Fastify Helmet or Express Helmet won't allow).
pip install pillow
python -c 'from PIL import Image;Image.new("RGBA", (1,1), color=(0,0,0,0)).save("favicon.ico", sizes=[(1,1)])'
favicon is meant to add information to the user about whether a browser tab or a saved URL (as desktop icon) contains. It's a good practice to have one and it needs to be placed on the root directory of your project with the name favicon.ico, because it's a web standard.
Inside your root HTML you can set up multiple icons as well, targeting specific devices like 'apple-touch-icon' or simply 'icon'.