Repository: syncthing/syncthing (language: go)

Issue:
favicon not working Firefox & derivative browsers
Firefox, Pale Moon, and similar browsers do not display the initial favicon (or at all) since the favicon link is dynamically created by evaluating javascript expressions. 

The bug is due to some FireFox forks not re-loading the scripted favicon link after the page first loading. Chrome and forks do, but this is non-standard behavior. 

See https://forum.syncthing.net/t/fixing-syncthing-favicons-in-firefox/15726 for description of cause and work around. 

I suggest that the initial favicon link not result in a 404, as noted by calmh at https://forum.syncthing.net/t/fixing-syncthing-favicons-in-firefox/15726/2. 

If it is desirable to have the favicon change based on status, the favicon link can be updated as at present. However, changing the favicon after page load does not appear to be standard behavior, so many browsers may not display the change. 


Discussion / hints:
Suggested code fix from Pale Moon developer: 

```
const favicon = document.querySelector('[rel=icon]');

function eventHandler(yourEvent) {
  favicon.href = "https://link.to/yourdynamicfavicon.ico";
}
```
The main <link> element should have a valid temporary/generic icon listed.

That should be cross-browser compatible, but even so, there's no guarantee that anything will be updated dynamically because, as said, the GUI isn't part of page content.
Would be nice if the icon also loads without authentication. This is mandatory for it to show up in password managers like Bitwarden.
It looks like for the favicon to load without authentication will require a default page -- at present the default page (which loads before authentication) is just a piece of text "Not Authorized". Once authentication takes place, the default.html page is loaded, which has the scripted favicon at issue above.

I"m not finding any html source to modify the "Not Authorized", so I suspect that it is direct output rather than served.

It seems that serving an initial unauthenticated html page would be the appropriate method for serving the initial favicon. 

Fix patch:
diff --git a/gui/default/index.html b/gui/default/index.html
index ac84df04c64..6e0d118d23e 100644
--- a/gui/default/index.html
+++ b/gui/default/index.html
@@ -12,7 +12,8 @@
   <meta charset="utf-8"/>
   <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
   <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
-  <link rel="shortcut icon" href="assets/img/favicon-{{syncthingStatus()}}.png"/>
+  <link rel="shortcut icon" href="assets/img/favicon-default.png" type="image/x-icon"/>
+  <link rel="shortcut icon" href="assets/img/favicon-{{syncthingStatus()}}.png" type="image/x-icon"/>
   <link rel="mask-icon" href="assets/img/safari-pinned-tab.svg" color="#0882c8"/>
 
   <title ng-bind="thisDeviceName() + ' | Syncthing'"></title>


Test patch: