I need to return a value in Swift by executing JavaScript, but I am having trouble I have searched everywhere, but I can't find anything that works. To execute the JavaScript, I am using
webby.evaluateJavaScript("document.querySelector(\"pre\").innerText;")
(Webby is the name of the web view) The JavaScript returns a string, which I would like to access in Swift. How would I accomplish this? Thanks.
document.querySelector(\"pre\").innerTextand run it in JavaScript it won't do anything. Perhaps you need areturnstatement before itreturn document.querySelector(\"pre\").innerText