This solution, found here, does work for disabling the action sheet all together but I'd like to disable it only for links or anchor tags and leave it working for images so I don't have to recreate that native functionality.
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
webView.evaluateJavaScript("document.body.style.webkitTouchCallout='none';", completionHandler: nil)
}
I'm not great with javascript but for someone who is I imagine this is trivial.
I've tried hobbling together something using the same webkitTouchCallout
but it isn't working for me. It doesn't produce any errors, it just doesn't disable the actionsheet at all.
webView.evaluateJavaScript("var anchors = document.anchors; var array = Array.prototype.slice.call( anchors, 0 ); array.forEach(function(anchor) { anchor.style.webkitTouchCallout='none'; });", completionHandler: { result, error in
print("Javascript didFinish Error: \(error)")
})