From 8cecec51933d2cce9316ba828d5296eed6930005 Mon Sep 17 00:00:00 2001 From: Alexander Danilov Date: Thu, 28 May 2026 16:30:26 +0500 Subject: [PATCH] fix(ios): skip subframe intercepts, improve auth popup support --- src/webview/index.ios.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/webview/index.ios.ts b/src/webview/index.ios.ts index 2d5169e..ec83aa3 100644 --- a/src/webview/index.ios.ts +++ b/src/webview/index.ios.ts @@ -675,6 +675,11 @@ export class WKNavigationDelegateNotaImpl extends NSObject implements WKNavigati } } + const isMainFrame = !navigationAction.targetFrame || navigationAction.targetFrame.mainFrame; + if (!isMainFrame) { + decisionHandler(WKNavigationActionPolicy.Allow); + return; + } const shouldOverrideUrlLoading = owner._onShouldOverrideUrlLoading(url, httpMethod, navType); if (shouldOverrideUrlLoading === true) { if (Trace.isEnabled()) { @@ -683,8 +688,8 @@ export class WKNavigationDelegateNotaImpl extends NSObject implements WKNavigati WebViewTraceCategory, Trace.messageType.info ); - decisionHandler(WKNavigationActionPolicy.Cancel); } + decisionHandler(WKNavigationActionPolicy.Cancel); return; } decisionHandler(WKNavigationActionPolicy.Allow); @@ -905,7 +910,7 @@ export class WKUIDelegateNotaImpl extends NSObject implements WKUIDelegate { popupWebView.customUserAgent = webView.customUserAgent; } - let currentVC = UIApplication.sharedApplication.keyWindow.rootViewController; + let currentVC = webView.window ? webView.window.rootViewController : null; while (currentVC && currentVC.presentedViewController) { currentVC = currentVC.presentedViewController; }