Before someone closes this because of mistakenly thinking it is a duplicated question, I'm referring to SVG favicon in particular instead of ICO format. And there is a reason for that.
I'm using an SVG favicon in order to support both light and dark modes. In other words, the icon will change colors automatically thanks to the @media (prefers-color-scheme: dark) query in the SVG file. I also have a favicon.ico placed in the root folder for fallback support (a.k.a. Safari mainly).
Yet, when I open a PDF in a new tab, favicon.svg will not be loaded instead, the favicon.ico is loaded regardless of whether the browser supports SVG favicon. That can be a problem because the two icons will look different in dark mode, where the SVG icon changes colors while the ICO doesn't.
So is there any way to make the browsers display the "correct" icon?





