-
Notifications
You must be signed in to change notification settings - Fork 986
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 for debug builds on iOS >= 16.4 #1300
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The master branch is already targeting the next major version, so I think we want to default this to NO in release builds (and YES in debug builds).
Thanks for adding the preference too! We'll want to add that to the cordova-docs repo (and maybe file an issue on cordova-android to obey the preference for inspecting there too)
@dpogue I've updated the code and PR description based on your feedback. I had to remove the default value for the setting from |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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 😞 |
That issue is caused by #1290 for reference. |
Concerns about allowing inspectable webview in the CordovaWebview where it has access to native device APIs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Disclaimer: Non-lawyer analysis.
I revoked my previous approval out of concerns that allowing webview to be inspectable may be in a clear violation of Section 4.7.1 of the App Guidelines.
However I believe Section 4.7.1 only applies to code that isn't bundled with the App binary. And I didn't find anything else (In the Apple Developer Agreement and XCode terms of use) that says device APIs cannot be exposed to users outside the developer platform.
Therefore, at the core, I think Cordova is in the clear, for both the core platform & use in the in app browser plugin (should the plugin also obey this kind of flag, which I know there is a PR to introduce that functionality).
If the developer does import code from remote sources then they may be breaching the agreement with Apple, however that isn't the concern of Apache Cordova, it will be up to the end-users to ensure they comply with Apple's terms.
So I'm returning my approval.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested with an iPad and code looks good to me. I will also merge this into a path release
Duplicate/partial implementation of apache/cordova-ios#1300
This is not working for me on iOS 16.4.1, MacOS 13.3.1, Safari 16.4. I'm running as follows: 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. |
Duplicate/partial implementation of apache/cordova-ios#1300
Duplicate/partial implementation of apache/cordova-ios#1300
…apache#1300) (cherry picked from commit e1e21cf)
* 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>
* 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>
* 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>
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
(platform)
if this change only applies to one platform (e.g.(android)
)