Search code examples
uiwebviewuiwindowuiwebviewdelegate

How to disable long touch in UIWebView?


I want to disable long-touch from the application. I have no control on the HTML that I am loading on my WebView.


Solution

  • In webViewDidFinishLoad delegate I run a javascript on the loaded html page that disable the long touch.

    [webView stringByEvaluatingJavaScriptFromString:@"document.body.style.webkitTouchCallout='none'; document.body.style.KhtmlUserSelect='none'"];