WebViewKit icon indicating copy to clipboard operation
WebViewKit copied to clipboard

How do you eval js on this great tool ?

Open SKbarbon opened this issue 2 years ago • 3 comments

How do you eval js on this great tool ? I mean to execute javascript code on the current webview page after the webview loaded

SKbarbon avatar Jun 24 '23 18:06 SKbarbon

Hi @SKbarbon

If you use the WKWebView-based WebView, you can use its evaluateJavaScript as described here:

https://www.hackingwithswift.com/example-code/wkwebview/how-to-run-javascript-on-a-wkwebview-with-evaluatejavascript

You can get the web view reference from the configuration block.

danielsaidi avatar Jun 24 '23 21:06 danielsaidi

I will add instructions about this to the docs.

danielsaidi avatar Oct 18 '23 09:10 danielsaidi

Thank you @danielsaidi

SKbarbon avatar Oct 20 '23 11:10 SKbarbon