@aigens/aigens-sdk-core 0.0.21 → 0.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -275,15 +275,15 @@ extension WebContainerViewController: WKNavigationDelegate {
|
|
275
275
|
}
|
276
276
|
|
277
277
|
// otherwise, is this a new window or a main frame navigation but to an outside source
|
278
|
-
let toplevelNavigation = (navigationAction.targetFrame == nil || navigationAction.targetFrame?.isMainFrame == true)
|
279
|
-
if navURL.absoluteString.contains(bridge.config.serverURL.absoluteString) == false, toplevelNavigation {
|
280
|
-
// disallow and let the system handle it
|
281
|
-
if UIApplication.shared.applicationState == .active {
|
282
|
-
UIApplication.shared.open(navURL, options: [:], completionHandler: nil)
|
283
|
-
}
|
284
|
-
decisionHandler(.cancel)
|
285
|
-
return
|
286
|
-
}
|
278
|
+
// let toplevelNavigation = (navigationAction.targetFrame == nil || navigationAction.targetFrame?.isMainFrame == true)
|
279
|
+
// if navURL.absoluteString.contains(bridge.config.serverURL.absoluteString) == false, toplevelNavigation {
|
280
|
+
// // disallow and let the system handle it
|
281
|
+
// if UIApplication.shared.applicationState == .active {
|
282
|
+
// UIApplication.shared.open(navURL, options: [:], completionHandler: nil)
|
283
|
+
// }
|
284
|
+
// decisionHandler(.cancel)
|
285
|
+
// return
|
286
|
+
// }
|
287
287
|
|
288
288
|
// fallthrough to allowing it
|
289
289
|
decisionHandler(.allow)
|
@@ -316,31 +316,31 @@ extension WebContainerViewController: WKNavigationDelegate {
|
|
316
316
|
CAPLog.print("⚡️ Error: " + error.localizedDescription)
|
317
317
|
}
|
318
318
|
|
319
|
-
// The force unwrap is part of the protocol declaration, so we should keep it.
|
320
|
-
// swiftlint:disable:next implicitly_unwrapped_optional
|
321
|
-
public func webView(_ webView: WKWebView, didFailProvisionalNavigation navigation: WKNavigation!, withError error: Error) {
|
322
|
-
webContainerView.showLoading(false)
|
323
|
-
// cancel
|
324
|
-
let e = error as NSError
|
325
|
-
if (e.code == NSURLErrorCancelled || e.code == -999) {
|
326
|
-
webContainerView.showError(false)
|
327
|
-
}
|
328
|
-
CAPLog.print("⚡️ WebView failed provisional navigation")
|
329
|
-
CAPLog.print("⚡️ Error: " + error.localizedDescription)
|
330
|
-
|
331
|
-
if let errorUrl = webView.url?.absoluteString {
|
332
|
-
print("navURL-- errorUrl: \(errorUrl)")
|
333
|
-
if (!self.redirectLink.isEmpty && errorUrl.starts(with: self.redirectLink)) {
|
334
|
-
webContainerView.showError(false)
|
335
|
-
webContainerView.showLoading(true)
|
336
|
-
}else {
|
337
|
-
webContainerView.showError(true, error.localizedDescription)
|
338
|
-
}
|
339
|
-
}else {
|
340
|
-
webContainerView.showError(true, error.localizedDescription)
|
341
|
-
}
|
342
|
-
|
343
|
-
}
|
319
|
+
// // The force unwrap is part of the protocol declaration, so we should keep it.
|
320
|
+
// // swiftlint:disable:next implicitly_unwrapped_optional
|
321
|
+
// public func webView(_ webView: WKWebView, didFailProvisionalNavigation navigation: WKNavigation!, withError error: Error) {
|
322
|
+
// webContainerView.showLoading(false)
|
323
|
+
// // cancel
|
324
|
+
// let e = error as NSError
|
325
|
+
// if (e.code == NSURLErrorCancelled || e.code == -999) {
|
326
|
+
// webContainerView.showError(false)
|
327
|
+
// }
|
328
|
+
// CAPLog.print("⚡️ WebView failed provisional navigation")
|
329
|
+
// CAPLog.print("⚡️ Error: " + error.localizedDescription)
|
330
|
+
//
|
331
|
+
// if let errorUrl = webView.url?.absoluteString {
|
332
|
+
// print("navURL-- errorUrl: \(errorUrl)")
|
333
|
+
// if (!self.redirectLink.isEmpty && errorUrl.starts(with: self.redirectLink)) {
|
334
|
+
// webContainerView.showError(false)
|
335
|
+
// webContainerView.showLoading(true)
|
336
|
+
// }else {
|
337
|
+
// webContainerView.showError(true, error.localizedDescription)
|
338
|
+
// }
|
339
|
+
// }else {
|
340
|
+
// webContainerView.showError(true, error.localizedDescription)
|
341
|
+
// }
|
342
|
+
//
|
343
|
+
// }
|
344
344
|
|
345
345
|
public func webViewWebContentProcessDidTerminate(_ webView: WKWebView) {
|
346
346
|
webView.reload()
|