Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gui: Fix Firefox bookmark favicon (fixes #9506) #9507

Merged
merged 1 commit into from May 1, 2024

Conversation

medusalix
Copy link
Contributor

@medusalix medusalix commented Apr 9, 2024

Purpose

Firefox uses the last specified favicon link for bookmarks, but only if it is available on initial page load.
Remove the second link and use ng-href to change the icon instead.

I'm not really familiar with AngularJS, feel free to offer suggestions for improvements.

Testing

Briefly tested on Firefox 124.0.2 and Chrome 123.0.6312.105.

@tomasz1986
Copy link
Contributor

tomasz1986 commented Apr 9, 2024

I wonder if you can't just do

<link rel="shortcut icon" href="assets/img/favicon-default.png" ng-href="assets/img/favicon-{{syncthingStatus()}}.png" type="image/x-icon"/>

without adding anything to the controller. This seems to work for me both in Firefox and Chromium.

@medusalix
Copy link
Contributor Author

medusalix commented Apr 9, 2024

I wonder if you can't just do

<link rel="shortcut icon" href="assets/img/favicon-default.png" ng-href="assets/img/favicon-{{syncthingStatus()}}.png" type="image/x-icon"/>

without adding anything to the controller. This seems to work for me both in Firefox and Chromium.

Thanks for the suggestion. Seems to work well and it's even simpler. I've updated the PR.

Firefox uses the last specified favicon link for bookmarks,
but only if it is available on initial page load.
Remove the second link and use ng-href to change the icon instead.
@calmh
Copy link
Member

calmh commented Apr 9, 2024

Neat

@calmh calmh merged commit ebb1edc into syncthing:main May 1, 2024
21 checks passed
calmh added a commit to calmh/syncthing that referenced this pull request May 9, 2024
* main: (45 commits)
  build: Use Go 1.22.3 at minimum
  build: Use Go 1.22.3 at minimum
  gui: Add Hindi (hi) translation template (syncthing#9530)
  gui, man, authors: Update docs, translations, and contributors
  lib/connections: Add syncthing_connections_active metric (fixes syncthing#9527) (syncthing#9528)
  etc: Use 7MiB buffer size (syncthing#9524)
  gui: Fix Firefox bookmark favicon (fixes syncthing#9506) (syncthing#9507)
  gui, man, authors: Update docs, translations, and contributors
  gui, man, authors: Update docs, translations, and contributors
  gui, man, authors: Update docs, translations, and contributors
  lib/nat: Don't crash on empty address list (fixes syncthing#9503) (syncthing#9504)
  lib/db: Drop indexes for outgoing data to force refresh (ref syncthing#9496) (syncthing#9502)
  gui: Fix missing link to device editor for names with superscript (ref syncthing#9472) (syncthing#9494)
  lib/db: Hold update lock while taking snapshot (syncthing#9496)
  build: Update dependencies (syncthing#9497)
  gui, man, authors: Update docs, translations, and contributors
  gui, man, authors: Update docs, translations, and contributors
  Removed no longer relevant Bountysource link (syncthing#9480)
  lib/api: Missing return after HTTP error
  lib/api: Extract session store (syncthing#9425)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants