This answer works in my case.
on click of downloadable link where videos will play I use below delegate of wkwebview:
func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Void) {
if navigationAction.navigationType == WKNavigationType.linkActivated {
print("downloadable link")
// add alert here
decisionHandler(WKNavigationActionPolicy.cancel)
}else{
decisionHandler(WKNavigationActionPolicy.allow)
}
here(on place of add alert here) you can add the alert same like Safari and use as per your requirement.