Open bithappens opened 1 year ago
Maybe something like this could be a start: document.querySelector("link[rel='shortcut icon']")
or document.querySelector("link[rel='icon']")
or document.querySelector("link[rel='icon'], link[rel='shortcut icon']").href
It seems like there is normalization of some type needed. If this is ever implemented, it needs a lot of tests and checks.
This has been my go-to for favicons and might help:
https://external-content.duckduckgo.com/ip3/github.com.ico
Cool! This seems like it solves many problems related to the preparation and filtering. Is there any documentation about it somewhere? For direct copy in the text 16x16 for example might be the better choice. Or rather, some experiments are needed for the optimal display into the copied text - and the different formats.
With the current info, the workflow seems to be: read window.location.host
- build the URL for ddg - download the icon - encode it into base64. Build the output format. Copy into clipboard.
No documentation that I'm aware of. It's used in DDG search results so it should be fairly reliable.
It would be nice if there is any option to copy the favicon in front of the text from the title. Nevertheless, there does not seem to be a direct way to include this in all formats. Not even to read the favicon via JavaScript.