mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
fix(ios-webview): report hostname lookup errors in loadFinished event (#6988)
This commit is contained in:
@@ -77,6 +77,20 @@ class WKNavigationDelegateImpl extends NSObject
|
||||
}
|
||||
}
|
||||
|
||||
public webViewDidFailProvisionalNavigationWithError(webView: WKWebView, navigation: WKNavigation, error: NSError): void {
|
||||
const owner = this._owner.get();
|
||||
if (owner) {
|
||||
let src = owner.src;
|
||||
if (webView.URL) {
|
||||
src = webView.URL.absoluteString;
|
||||
}
|
||||
if (traceEnabled()) {
|
||||
traceWrite("WKNavigationDelegateClass.webViewDidFailProvisionalNavigationWithError(" + error.localizedDescription + ")", traceCategories.Debug);
|
||||
}
|
||||
owner._onLoadFinished(src, error.localizedDescription);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export class WebView extends WebViewBase {
|
||||
|
||||
Reference in New Issue
Block a user