WKWebView/UIWebView获取网站图标 [英] WKWebView/UIWebView get website icon

查看:630
本文介绍了WKWebView/UIWebView获取网站图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用WKWebView或UIWebView获取网站的apple-touch-icon或徽标?我读过有可能获得favicon,但是我打算像在iOS Safari中那样将网站徽标用作快捷方式,而favicon太小了.有没有一种方法可以从webView的网站中刮取元数据以获取<link rel="apple-touch-icon" href="apple-touch-icon.png">?

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">?

推荐答案

在iOS的Firefox中,我们使用

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).

这篇关于WKWebView/UIWebView获取网站图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆