I am working on a browser WebExtension, one feature of my extension is to get the icon image and name of the website which user is browsing. I found some ways to get the icon, e.g
- https://<some domain>/favicon.ico
- link and metadata in header, such as
<meta property="og:image" content="<some image link>" />
,<link rel="apple-touch-icon" href="<some image link>"
.
As for the website name, I can use
- document.title
- metadata in header, such as
<meta name="application-name" content="some name">
- the second level domain name
However, that is still not enough, I found the result is not satisfying on quite a lot websites.
I am wondering is there some list of those heuristics or routines to cover most of the cases.
Or is there any advice or better approach to get the site's logo/icon and name?
Thank you