from Domain
Get valid icon information, by trying to access to some icon from the root of domain of specified URL.
Do not call from main thread to avoid NetworkOnMainThreadException
Judge the existence of icon using HTTP HEAD. Since many of these sites do not have these icons, 404 errors are recorded on the server. Because it is a bad manners, execution should be kept to a minimum.
Checks the existence of the icon in order, and returns the information when judging that the icon exists. Processing is interrupted at the stage of finding the icon, and no confirmation is made on it after that
The order of checking the existence of the icon is as follows
In case of withPrecomposed
is false and sizes
is not specify.
apple-touch-icon.png
favicon.ico
In case of withPrecomposed
is true and sizes
is not specify.
apple-touch-icon-precomposed.png
apple-touch-icon.png
favicon.ico
In case of withPrecomposed
is true and sizes
is listOf("120x120", "72x72")
apple-touch-icon-120x120-precomposed.png
apple-touch-icon-120x120.png
apple-touch-icon-72x72-precomposed.png
apple-touch-icon-72x72.png
apple-touch-icon-precomposed.png
apple-touch-icon.png
favicon.ico
Return
First acquired icon
Parameters
URL of analysis target page
If specify true, include the "precomposed". default is true
Specify this when appending size (e.g. 80x80) to apple-touch-icon. Default is empty.