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
feat: Add LimitsNavigationsToAppBoundDomains configuration key #1249
feat: Add LimitsNavigationsToAppBoundDomains configuration key #1249
Conversation
Add support for limitsNavigationsToAppBoundDomains webkit configuration: https://webkit.org/blog/10882/app-bound-domains/
I don't know how can I write a test for this honestly. |
Thanks for the pull request! You probably want to target this to the master branch though. I think app-bound domains are definitely something we want to support in cordova-ios, particularly because it will enable easier access to a bunch of APIs, as you mentioned. However, I think for this to work, it will also need to populate the |
Codecov Report
@@ Coverage Diff @@
## master #1249 +/- ##
==========================================
+ Coverage 74.88% 78.62% +3.73%
==========================================
Files 13 15 +2
Lines 1724 1773 +49
==========================================
+ Hits 1291 1394 +103
+ Misses 433 379 -54 see 28 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
You can only list 10 You are right navigating to a not set domain will trigger an error:
I can create a separete merge request for the |
Thanks for adding this @gazben ! I'm not sure why I didn't contribute this back here and just put it in the blog post, but you're being a better open source contributor than me :) |
@ochakov Can you merge this, or who should I contact? |
Co-authored-by: エリス <erisu@users.noreply.github.com>
Sorry, reverted. |
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.
This looks good to me as a stepping stone to exploring the full potential app-bound domains.
For now, this will allow people to turn on app-bound domains, and they can use edit-config
in config.xml to add domains to their Info.plist
file. In the future we can explore whether it makes sense to automatically populate app-bound domains from access
/allow-navigation
/allow-intent
tags, but I don't think we have enough information about the exact behaviour of app-bound domains to make that call yet.
As an FYI I've been using this change in production for half a year now (~2k users) no problems reported yet. My comment still stands from earlier, that I don't think that the automatic population is feasible because of the heavy size limitation. |
Same here 👍 |
Thanks @gazben for the contribution! 🎉 |
Platforms affected
IOS
Motivation and Context
Currently there is no option to set the limitsNavigationsToAppBoundDomains attribute from the
config.xml
. If you want to use cookie authentication or browser APIs you want to set this toYES
.Official documentation: https://webkit.org/blog/10882/app-bound-domains/
Description
This changeset is copied from this tutorial: https://www.ryseapp.io/blog/engineering/step-by-step-guide-to-setup-and-configure-cordova-for-ios-and-android-to-load-a-hosted-react-app
Testing
Tested on multiple simulator instances and and physical hardware. Without it the cookie authentication for a single domain will not work. After I add this change the authentication works.
Checklist
(platform)
if this change only applies to one platform (e.g.(android)
)