Skip to content

Commit

Permalink
Webkit ios 16.4 enable inspection (#677)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
spoxies and kppv authored Aug 29, 2023
1 parent ab7dfc0 commit 9c11a20
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 9c11a20

Please sign in to comment.