You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by jc...@apache.org on 2023/08/24 23:53:01 UTC
[cordova-plugin-inappbrowser] branch webview-debug created (now 21b2df3)
This is an automated email from the ASF dual-hosted git repository.
jcesarmobile pushed a change to branch webview-debug
in repository https://gitbox.apache.org/repos/asf/cordova-plugin-inappbrowser.git
at 21b2df3 feat(ios): Make WebView inspectable
This branch includes the following new commits:
new 21b2df3 feat(ios): Make WebView inspectable
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[cordova-plugin-inappbrowser] 01/01: feat(ios): Make WebView inspectable
Posted by jc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jcesarmobile pushed a commit to branch webview-debug
in repository https://gitbox.apache.org/repos/asf/cordova-plugin-inappbrowser.git
commit 21b2df3fa5dfff772c2799088022b3a8bcbe925a
Author: jcesarmobile <jc...@gmail.com>
AuthorDate: Fri Aug 25 01:52:44 2023 +0200
feat(ios): Make WebView inspectable
---
src/ios/CDVWKInAppBrowser.m | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/src/ios/CDVWKInAppBrowser.m b/src/ios/CDVWKInAppBrowser.m
index 2adcf0c..5cf8e15 100644
--- a/src/ios/CDVWKInAppBrowser.m
+++ b/src/ios/CDVWKInAppBrowser.m
@@ -18,6 +18,7 @@
*/
#import "CDVWKInAppBrowser.h"
+#import <Cordova/NSDictionary+CordovaPreferences.h>
#if __has_include(<Cordova/CDVWebViewProcessPoolFactory.h>) // Cordova-iOS >=6
#import <Cordova/CDVWebViewProcessPoolFactory.h>
@@ -774,6 +775,21 @@ BOOL isExiting = FALSE;
self.webView = [[WKWebView alloc] initWithFrame:webViewBounds configuration:configuration];
+
+#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 160400
+ // With the introduction of iOS 16.4 the webview is no longer inspectable by default.
+ // We'll honor that change for release builds, but will still allow inspection on debug builds by default.
+ // We also introduce an override option, so consumers can influence this decision in their own build.
+ if (@available(iOS 16.4, *)) {
+#ifdef DEBUG
+ BOOL allowWebviewInspectionDefault = YES;
+#else
+ BOOL allowWebviewInspectionDefault = NO;
+#endif
+ self.webView.inspectable = [_settings cordovaBoolSettingForKey:@"InspectableWebview" defaultValue:allowWebviewInspectionDefault];
+ }
+#endif
+
[self.view addSubview:self.webView];
[self.view sendSubviewToBack:self.webView];
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org