Reputation: 668
My iOS app needs to display very basic HTML received from a third party (using loadHTMLString
with nil as baseURL
).
Using a UIWebView
was simple enough, however - I have a security concern since this view can also run Javascript, which is not allowed and also unnecessary for my app.
Is there a way to disable the app from running javascript? If not - does anyone know of a good sanitizing code to remove any malicious stuff (yet keep the regular HTML) from an NSString
?
Thanks, Lior
Upvotes: 3
Views: 2741
Reputation: 1557
have you tried to use WKWebView it have the configuration option where you can set
javaScriptEnabled = NO;
Upvotes: 2