Search code examples
iosuiwebviewmetadatawkwebviewapple-touch-icon

WKWebView/UIWebView get website icon


How can I get the apple-touch-icon or logo of the website using WKWebView or UIWebView? I've read that getting a favicon is possible, however I plan on using the website's logo as a short cut like in iOS Safari and a favicon is too small for it. Is there a way to scrape metadata from a website in webView to get <link rel="apple-touch-icon" href="apple-touch-icon.png">?


Solution

  • In Firefox for iOS we use a User Script (Link to code on Github) to find the icon that then passes them back to the application which downloads them using native code (Link to code on Github).