Search code examples
iosxcodemobile-safariwkwebview

Do you know how to zoom content in WKWebView like it does safari?


I need to add to WKWebView the same functionality as safari has (aA). But I don't find any properties in WKWebView which allow to do the same.

Do you know how safari does this?

Is it possible to reproduce the same in WKWebView? example of functionality in Safari here


Solution

  • just use this

    let js = "document.getElementsByTagName('body')[0].style.webkitTextSizeAdjust='200%'"//dual size
    webView.evaluateJavaScript(js, completionHandler: nil)