Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does "block all network load requests" mean?

I am looking for ways to speed up WebView loading and I came across WebSettings.setBlockNetworkLoads() which is described very briefly in the documentation:

Tell the WebView to block all network load requests.

But it's unclear to me what "all network load requests" mean.

Does it block loading images, like setBlockNetworkImage() does?

Does it block other things? (if so, what does it block?)

like image 949
ef2011 Avatar asked Oct 10 '22 11:10

ef2011


2 Answers

According to this code sample it means "preventing WebView from loading external resources over the network".

I interpret this as allowing to load resources locally (cache, memory) but not over the network, not even a URL that you explicitly specify.

So, just as you observed, it will block everything, including images.

like image 189
uTubeFan Avatar answered Nov 07 '22 07:11

uTubeFan


I have never used that particular setting but without any further context I would think that it means the WebView .load methods.

WebView.loadData(String data, String mimeType, String encoding);
WebView.loadDataWithBaseURL(String baseUrl, String data, String mimeType, String encoding, String historyUrl);
WebView.loadUrl(String url);
WebView.loadUrl(String url, Map<String, String> extraHeaders);
like image 43
FoamyGuy Avatar answered Nov 07 '22 07:11

FoamyGuy