Skip to content

favicon not working Firefox & derivative browsers #7638

Closed

Description

@ajshea

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.

Activity

  1. added
    bug
    needs-triage
    on May 7, 2021
  2. ajshea commented on May 11, 2021

    @ajshea
    Author

    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 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.

  3. bt90 commented on May 12, 2021

    @bt90
    Contributor

    Would be nice if the icon also loads without authentication. This is mandatory for it to show up in password managers like Bitwarden.

  4. ajshea commented on May 12, 2021

    @ajshea
    Author

    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.

  5. added
    ui
    and removed
    needs-triage
    on Jan 29, 2022
  6. added a commit that references this issue on Jun 14, 2023
    c369f8a
  7. added this to the v1.23.6 milestone on Jun 27, 2023
  8. added
    frozen-due-to-age
    on Jun 13, 2024
  9. locked and limited conversation to collaborators on Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugfrozen-due-to-ageui

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions