Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set webView.inspectable to true on iOS >= 16.4 #995

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/ios/CDVWKInAppBrowser.m
Original file line number Diff line number Diff line change
Expand Up @@ -778,6 +778,14 @@ - (void)createViews
[self.view addSubview:self.webView];
[self.view sendSubviewToBack:self.webView];

#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 160400
// Set "inspectable" to true for backwards compatibility with iOS <= 16.3, but allow an override.
// Preferably this would be set to the default "NO" or wrapped in an "#ifdef DEBUG",
// but that would be a breaking change and needs to wait till a (next) major release.
if (@available(iOS 16.4, *)) {
self.webView.inspectable = [settings cordovaBoolSettingForKey:@"InspectableWebview" defaultValue:YES];;
}
#endif

self.webView.navigationDelegate = self;
self.webView.UIDelegate = self.webViewUIDelegate;
Expand Down