2

I have one html page open inside UiWebViewController with cordova. While index.html loading inside the Uiwebviewcontroller can we sniff the requests that is originating from index.html?

for example I have following html that is getting opened in UiWebviewcontroller:

<html>
<head>
   <link rel="stylesheet" type="text/css" href="theme.css">
    <script src="app.js"></script>
</head>
<body>
   <img src="img.jpg"/>
</body>
</html>

Can I sniff and modify the url that is getting requested inside Uiwebviewcontroller ie. img.jpg,theme.css,app.js to something like content/img.jpg, css/theme.css, js/app.js using Objective-C.

1 Answer 1

1

Yes, that’s possible using NSURLProtocol, see this blog post by NSHipster and this related Stack Overflow thread.

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.