From 815f9c5f1d4620187ccbc2725cf512675891f611 Mon Sep 17 00:00:00 2001 From: Nick Date: Tue, 11 May 2021 00:15:21 +0300 Subject: [PATCH 1/2] Fix WKWebView with embedded iframe before fix - main frame on load navigated to iframe url now - if webview has iframe - its will be ignored --- src/webview-utils.ios.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/webview-utils.ios.ts b/src/webview-utils.ios.ts index a676985..d078c7f 100644 --- a/src/webview-utils.ios.ts +++ b/src/webview-utils.ios.ts @@ -29,7 +29,7 @@ class WebviewUtilsWKNavigationDelegateImpl extends NSObject implements WKNavigat }); if (isHttpRequest && !areHeadersAdded) { - if (navigationAction.request.HTTPMethod !== "GET") { + if (navigationAction.request.HTTPMethod !== "GET" || !navigationAction.targetFrame.mainFrame) { decisionHandler(WKNavigationActionPolicy.Allow); return; } From 45b843053a717b6d69e37b2c81f96031ddd7cc08 Mon Sep 17 00:00:00 2001 From: Nick Date: Tue, 11 May 2021 20:18:47 +0300 Subject: [PATCH 2/2] Update webview-utils.ios.ts --- src/webview-utils.ios.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/webview-utils.ios.ts b/src/webview-utils.ios.ts index d078c7f..f9a3c3a 100644 --- a/src/webview-utils.ios.ts +++ b/src/webview-utils.ios.ts @@ -29,7 +29,7 @@ class WebviewUtilsWKNavigationDelegateImpl extends NSObject implements WKNavigat }); if (isHttpRequest && !areHeadersAdded) { - if (navigationAction.request.HTTPMethod !== "GET" || !navigationAction.targetFrame.mainFrame) { + if (navigationAction.request.HTTPMethod !== "GET" || (navigationAction.targetFrame && !navigationAction.targetFrame.mainFrame)) { decisionHandler(WKNavigationActionPolicy.Allow); return; }