I loaded the webpage in WKWebView . I want to determine when the user clicks this button.
<div class="compacted-item"> <button class="btn btn-lg btn-primary deploy-button" data-ember-action="1361"> Deploy </button> </div>
decidePolicyFor navigationAction does not start because it is not a navigation action.
I know how to add a js message handler to the web view content controller, but since I don't own the web page, how do I get it to send a message to intercept? For instance:
window.webkit.messageHandlers.buttonClicked.postMessage(messageToPost);
Or is there another way to detect clicks without navigation in WKWebView ?
source share