Disable Android WebView/WebViewClient Initiated favicon.ico Request

后端 未结 5 873
独厮守ぢ
独厮守ぢ 2021-01-11 16:27

How can I disable the Android WebView/WebViewClient from sending out a request for favicon.ico when I call WebView.loadUrl()? I can see the call being made while profiling r

5条回答
  •  太阳男子
    2021-01-11 17:22

    There is a method for WebView class named getFavicon(). I think that method is called by WebView to retrieve the favicon from server by issuing request. So you can try extending the WebView class and override the getFavicon() method to do nothing. I haven't tried it myself but this might work.

提交回复
热议问题