How to have website’s favicon for documents that are opened in a new tab?
At the moment when, say, a .PDF is opened a new tab appears with the document but the standard Umbraco ‘U’ favicon is displayed. I need to be able to show the relevant site favicon instead. I have had a quick look into this but most solutions seem to point to changing the icon in the Baseline project, but this will surely affect the favicon for all websites? My installation has multiple sites where the favicon is served correctly at the page level by ‘Metadata.cshtml’
I have tried to attach a screengrab (showing two tabs, one of my website with the correct favicon and another tab showing the .PDF with the default Umbraco favicon) but am getting an error.
But that would require you to add some middleware to add the header. And in that middleware, you would have to somehow determine what site your are on, eg. by looking at the hostname.
It would ultimately end up making requests to your files slower.
So as it stands, the server gets the request for the file directly, grabs the favicon in the wwwroot and uses that. Umbraco itself isn’t touched by default.
I would need to intercept this call, look at the URL and serve up the appropriate favicon instead?