webkitTextSizeAdjust in WKWebView not working in iOS 13b2

Hi,


I have a wkwebview that I've added some font scaling accessibility controls to. In iOS13b2 it appears to not be working any longer. I'm hoping this is just a bug and not something they aren't supporting anymore. I've not been able to use any Feedback Assistants to file a bug (it says feedback is closed).


Here's what I'm doing that is no longer changing the font size:


func webViewEvaluateJS() {
        let js = "document.getElementsByTagName('body')[0].style.webkitTextSizeAdjust='\(fontSize)%'"
        webView.evaluateJavaScript(js, completionHandler: nil)
    }


fontSize is a var I declare that gets updated on a UISlider - I have a didSet that fires the webViewEvaluateJS().


Anyone else using/experiencing something similiar ?


Thanks.

Replies

Hi,


we have similar problem. It seems that WkWebView.evaluateJavaScript does not work in beta 2 and beta 3 regardless code passed into it..

We are not sure, can you check it?


regard

VaclavT

Hi,


after some exploration we found solution.. Adding a few lines helped us. Since that evaluateJavascript work again..


let theConfiguration = WKWebViewConfiguration()

let dummyScript = WKUserScript(source: "1 + 1", injectionTime: .atDocumentEnd, forMainFrameOnly: true)

theConfiguration.userContentController.addUserScript(dummyScript)


webView = WKWebView(frame:self.view.frame, configuration: theConfiguration)


regards

VaclavT