mirror of
https://github.com/floccusaddon/floccus.git
synced 2026-04-25 22:26:06 +03:00
[GH-ISSUE #1188] Android : Some Favicons not loading #792
Labels
No labels
browser-specific
bug
correctness issues
enhancement
feature: Google Drive
feature: Linkwarden
feature: git
feature: nextcloud-bookmarks
feature: tabs
feature: webdav
help wanted
native-app
priority: high
priority: low
priority: medium
pull-request
question
question
stale
upstream
waiting for more information
wontfix
🙁 Not following issue template
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/floccus#792
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @pinpontitit on GitHub (May 31, 2022).
Original GitHub issue: https://github.com/floccusaddon/floccus/issues/1188
Which version of floccus are you using?
4.15
Sync method
{"label"=>"Google Drive"}
Which browser are you using? In case you are using the Android App, specify the Android version please.
No response
Which version of Nextcloud Bookmarks are you using? (if relevant)
No response
Which version of Nextcloud? (if relevant)
No response
What kind of WebDAV server are you using? (if relevant)
No response
Describe the Bug
In Android app, 4.14 already, and also 4.15,
some favicons won't load.
I don't know if floccus is the culprit or if it's the websites that are misconfigured ?
Because in desktop browser they work.
Sometimes I have two differents bookmarks with the same Website Domain, but different pages inside this domain, and one has the favicon and the other not.
For example "Codewars" and "Codewars completed kata" on the image below.

Google maps favicon works, but Google Mail don't.

Also Replit and Codepen never worked.
Thanks
Expected Behavior
I wish all the favicons could work.
To Reproduce
..
Debug log provided
@marcelklehr commented on GitHub (May 31, 2022):
I noticed it as well but haven't bothered to check why so far.
The algorithm is here: https://github.com/floccusaddon/floccus/blob/develop/src/lib/getFavicon.js
@pinpontitit commented on GitHub (May 31, 2022):
I'll check tonight if I'm able to decrypt the code 😉
@pinpontitit commented on GitHub (May 31, 2022):
Ok I think I understand more or less how it works.
It parses the html of the website for "link" elements.
Then check if there's a rel "attribute" inside.
If the "rel" attribute contains "icon" in it,
then if the "href" is relative, or doesnt contain http, etc, it will add all those things.
etc..
I tried looking into the html source code of many websites from which the favicon weren't working in my floccus android, and also some where it works. And I coulndt find a repeating pattern that would lead me to the solution.
However, I concluded that maybe there are multiple causes to this bug and that it depends on the website:
The source code doesnt have a "link" element with "rel" and "icon" on it.
Instead it has it decomposed like that:
Is it that the parser used by getIcons() , can't read that kind of "presentation" of the "link" element ?
For "Codewars completed kata" (https://www.codewars.com/users/pinpontitit/completed) :
There's simply no "rel="icon" or "rel="shortcut icon" or whatever in this website HTML source code, so I guess it's their fault that your code can't reach a favicon.
However, browsers are able to fetch that favicon anyway. I guess they have another method to do it but which one ?
for CodePen (https://codepen.io/) that's a mistery because the source code has proper tags with "rel="shortcut icon", etc...
However I noticed that, in this website(codepen) but also in many other websites, there's a lot of time at least two "link" element with "ref" tag containing the word icon:
For example, in codepen:
And there's something suprising in your code:
If I understood it right, getFavicon.js , because of the for loop, will return many links that comply with the if conditions you set.
So at the end, the function will return an array called "icons", that should contain all those href links.
I was thinking that, after, floccus would try the first link to create a favicon. Then if that first link don't work, it would try the second one, etc., until the default mdi-icon.
But I noticed in FaviconImage.vue, that it only tries the first one, at index 0:
Is it wanted ?
Maybe it's a compatibility issue from Android or Vue with some format (.ico vs .png) or some "sizes", and testing different links would work ?
However, all the Codepen links correctly show an image in Chrome or Firefox, so why shouldn't it work in Android...
I've reached my limit of knowledge...
I wish I could test the code step by step, but I don't know how, there's so much methods that won't work to debug with vsCode.
I also don't know how to provide the "html" data to the function. I always got errors if I paste it as a string.
Etc.
@marcelklehr commented on GitHub (Jun 8, 2022):
I've added a /favicon.ico fallback for cases where the link element is missing
@github-actions[bot] commented on GitHub (Jun 9, 2023):
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.