I am trying to run a javascript command that works if I run it in the console on the web. I have tried doing the code below, but I keep getting nil as my response.
webView.evaluateJavaScript("command") { (result, error) in
if error == nil {
print(result)
} else {
print(error)
}
}
Here is the code to inject javascript code in your WKWebView