Repository navigation
refactor: default to file scheme - #866
Conversation
Codecov Report
@@ Coverage Diff @@
## master #866 +/- ##
=======================================
Coverage 74.40% 74.40%
=======================================
Files 13 13
Lines 1676 1676
=======================================
Hits 1247 1247
Misses 429 429 Continue to review full report at Codecov.
|
NiklasMerz
left a comment
There was a problem hiding this comment.
Just checked the code with my limited knowledge. LGTM 👍
jcesarmobile
left a comment
There was a problem hiding this comment.
Here we should cheek if the appScheme is not null, otherwise it adds (null):// to allowNavigations
https://github.com/apache/cordova-ios/blob/master/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.m#L48
Similar thing here https://github.com/apache/cordova-ios/blob/master/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewEngine.m#L163
it makes window.CDV_ASSETS_URL to be"(null)://", we should probably just not set it so it's undefined.
Finally the convertFilePath function should check if window.CDV_ASSETS_URL is undefined and in that case just return the same path that was provided without modifications.
The feedback suggestions were applied
4251ee8 to
ac2db4c
Compare
ac2db4c to
653cbf9
Compare
|
I have a hard time understanding how to use custom scheme with cordova-ios 6, specifically the behaviour introduced here : In the description of the behaviour by erisu, it says :
But in the code, the actual condition is : which, to my understanding of Objective-C, means that if it IS valid, it will default to app, cf. WKWebView handlesURLScheme documentation here Could someone clarify this to me ? |
|
During the course of development, defaulting to custom scheme was changed to default to the file url. The reasoning is because changing protocols will cause users to be missing their web storage data. So we wanted to make schemes an opt-in feature instead. I don't think this feature is documented yet, but an example config to use schemes can be found at #781 (review) |
|
|
|
Cordova-ios@6.1.0 says 'refactor: default to file scheme', why the url of my app is still |
Motivation and Context
Use
fileas default scheme to avoid break in current apps/Description
fileif preferenceschemeis not set.fileif preference scheme is set tofile.schemeas a custom scheme handler, excludingfilewhich was defined in the above case 2.hostnameis only used whenschemeis notfile.CDV_ASSETS_URLis set to<scheme>://<hostname>-> if
file,hostname = “”.-> if
!file,hostname = "localhost"or user define value for preferencehostname.schemeis set and is notfile, it will also validate againstWKWebView handlesURLScheme, if it is not valid, it will default toappTesting
Checklist