1

I have a WebView and am supplying it with content. What I would like to prevent is the WebView from loading images, etc. based on the content I have supplied which it needs to obtain from external sites on the internet. What I want to do is to prevent the WebView from communicating over the internet to obtain any resources and to only display what I have provided.

What I thought might work is to return nil from:

-webView:resource:willSendRequest:redirectResponse:fromDataSource: 

but, images, etc. are still loaded from external sites.

1 Answer 1

1

Implement the WebResourceLoadDelegate protocol and modify the request when asked -webView:resource:willSendRequest:redirectResponse:fromDataSource:.

Sign up to request clarification or add additional context in comments.

1 Comment

This is, of course, the answer, which I also provided in the question. The silly mistake I had made was not assigning the load delegate properly so this method would get called for the WebView that was not working correctly.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.