Skip to content

Commit

Permalink
Webkit ios 16.4 enable inspection ionic-team#677
Browse files Browse the repository at this point in the history
  • Loading branch information
JyrkiRytkonen committed Jul 19, 2023
1 parent ab7dfc0 commit 2fe21ad
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/ios/CDVWKWebViewEngine.m
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,20 @@ - (void)pluginInitialize
if ([settings cordovaBoolSettingForKey:@"KeyboardAppearanceDark" defaultValue:NO]) {
[self setKeyboardAppearanceDark];
}

#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
wkWebView.inspectable = [settings cordovaBoolSettingForKey:@"InspectableWebview" defaultValue:allowWebviewInspectionDefault];
}
#endif

[self updateSettings:settings];

// check if content thread has died on resume
Expand Down

0 comments on commit 2fe21ad

Please sign in to comment.