Skip to content

Commit 9c11a20

Browse files
spoxieskppv
andauthored
Webkit ios 16.4 enable inspection (#677)
* extension -> mime explicit mapping * Set webView.inspectable to true for debug builds on iOS >= 16.4 Duplicate/partial implementation of apache/cordova-ios#1300 --------- Co-authored-by: Pavel Kurdyukov <kurdyukov.pavel@gmail.com>
1 parent ab7dfc0 commit 9c11a20

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/ios/CDVWKWebViewEngine.m

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,20 @@ - (void)pluginInitialize
299299
if ([settings cordovaBoolSettingForKey:@"KeyboardAppearanceDark" defaultValue:NO]) {
300300
[self setKeyboardAppearanceDark];
301301
}
302-
302+
303+
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 160400
304+
// With the introduction of iOS 16.4 the webview is no longer inspectable by default.
305+
// We'll honor that change for release builds, but will still allow inspection on debug builds by default.
306+
// We also introduce an override option, so consumers can influence this decision in their own build.
307+
if (@available(iOS 16.4, *)) {
308+
#ifdef DEBUG
309+
BOOL allowWebviewInspectionDefault = YES;
310+
#else
311+
BOOL allowWebviewInspectionDefault = NO;
312+
#endif
313+
wkWebView.inspectable = [settings cordovaBoolSettingForKey:@"InspectableWebview" defaultValue:allowWebviewInspectionDefault];
314+
}
315+
#endif
303316
[self updateSettings:settings];
304317

305318
// check if content thread has died on resume

0 commit comments

Comments
 (0)