FreeOTPPlus icon indicating copy to clipboard operation
FreeOTPPlus copied to clipboard

Import icon from URL Favicon

Open pigsflew opened this issue 4 years ago • 2 comments

I'd love to be able to fetch an icon via issuer (or other) url.

pigsflew avatar Oct 27 '21 08:10 pigsflew

Sounds like a good idea in theory. I don't know how to fetch a favicon without loading the website and parsing the HTML to get it. It seems like a costly option.

helloworld1 avatar Oct 27 '21 23:10 helloworld1

Hello, i had the same idea. Downloading the "http://berlin.de/favicon.ico" does not work. I learned you have to parse the website for 'rel="shortcut icon"' string. This can be complicated.

But i also found a google link/tool which downloads the favicon. (I don´t want to use google ... but maybe this is an idea)

From here: https://superuser.com/questions/157925/how-to-download-favicon-from-website

You can do this using Google S2 converter.
Here is the syntax : http://www.google.com/s2/favicons?domain=DomainName
ex: http://www.google.com/s2/favicons?domain=https://superuser.com/

You can download in different sized when adding "size"

Example when used like above: https://t3.gstatic.com/faviconV2?client=SOCIAL&type=FAVICON&fallback_opts=TYPE,SIZE,URL&url=https://smdv.de&size=64

More Info: https://dev.to/derlin/get-favicons-from-any-website-using-a-hidden-google-api-3p1e Also see comments for other companies/urls which offer the same service!! E.g. duckduckgo

Could you add this "tool" in the app. Of course with a warning, that a third party tool is used. Or could you collect once all icons "we" need and add them?

pm-pm avatar Jun 26 '23 04:06 pm-pm