apache / cordova-ios

Apache Cordova iOS
https://cordova.apache.org/
Apache License 2.0
2.15k stars 987 forks source link

Set webView.inspectable to true for debug builds on iOS >= 16.4 #1300

Closed BBosman closed 1 year ago

BBosman commented 1 year ago

Platforms affected

iOS

Motivation and Context

With the introduction of iOS 16.4 WKWebView instances will no longer be inspectable by default.

Details: Enabling the Inspection of Web Content in Apps

Description

This PR honors that change for Release builds, but explicitly sets the inspectability to YES for Debug builds by default. It also introduce an override option, so consumers can influence this decision in their own build.

Testing

Tested the code in one of our own apps.

Checklist

BBosman commented 1 year ago

@dpogue I've updated the code and PR description based on your feedback.

I had to remove the default value for the setting from defaults.xml, as that would always override the build based default setting in the code.

BBosman commented 1 year ago

I can't explain the CI failure, but it looks unrelated to my changes?

dpogue commented 1 year ago

I can't explain the CI failure, but it looks unrelated to my changes?

yeah, test failures are due to some URL parsing changes in Node 18, unrelated to these changes 😞

breautek commented 1 year ago

I can't explain the CI failure, but it looks unrelated to my changes?

That issue is caused by https://github.com/apache/cordova-ios/issues/1290 for reference.

daviesdoclc commented 1 year ago

This is not working for me on iOS 16.4.1, MacOS 13.3.1, Safari 16.4.

I'm running as follows: cordova run ios --device --debug

I also tried setting InspectableWebview to true in config.xml.

breautek commented 1 year ago

This is not working for me on iOS 16.4.1, MacOS 13.3.1, Safari 16.4.

I'm running as follows: cordova run ios --device --debug

I also tried setting InspectableWebview to true in config.xml.

Let's create a new issue, using the issue template so that we can try to drill down and isolate the cause.