File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ Licensed to the Apache Software Foundation (ASF) under one
18
18
*/
19
19
20
20
#import " CDVWKInAppBrowser.h"
21
+ #import < Cordova/NSDictionary+CordovaPreferences.h>
21
22
22
23
#if __has_include(<Cordova/CDVWebViewProcessPoolFactory.h>) // Cordova-iOS >=6
23
24
#import < Cordova/CDVWebViewProcessPoolFactory.h>
@@ -774,6 +775,21 @@ - (void)createViews
774
775
775
776
776
777
self.webView = [[WKWebView alloc ] initWithFrame: webViewBounds configuration: configuration];
778
+
779
+ #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 160400
780
+ // With the introduction of iOS 16.4 the webview is no longer inspectable by default.
781
+ // We'll honor that change for release builds, but will still allow inspection on debug builds by default.
782
+ // We also introduce an override option, so consumers can influence this decision in their own build.
783
+ if (@available (iOS 16.4 , *)) {
784
+ #ifdef DEBUG
785
+ BOOL allowWebviewInspectionDefault = YES ;
786
+ #else
787
+ BOOL allowWebviewInspectionDefault = NO ;
788
+ #endif
789
+ self.webView .inspectable = [_settings cordovaBoolSettingForKey: @" InspectableWebview" defaultValue: allowWebviewInspectionDefault];
790
+ }
791
+ #endif
792
+
777
793
778
794
[self .view addSubview: self .webView];
779
795
[self .view sendSubviewToBack: self .webView];
You can’t perform that action at this time.
0 commit comments