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
have you tried to use WKWebView it have the configuration option where you can set
javaScriptEnabled = NO;
https://developer.apple.com/library/ios/documentation/WebKit/Reference/WKPreferences_Ref/index.html#//apple_ref/occ/instp/WKPreferences/javaScriptEnabled
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With