-
Notifications
You must be signed in to change notification settings - Fork 760
feat(ios): Added support for https urls access to local files. #296
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
base: master
Are you sure you want to change the base?
Conversation
Fixed typo
@guylando I'm having this issue too. |
@syonip my changes work well, seems just that this repository is not maintained too much. |
@janpio I think the android tag is wrong since this is an ios modification |
Correct, that was a miscategorization. Fixed it. |
Restart tests. |
Hey @guylando, does |
CI: Please run the tests again. |
CI: Once more please. |
@janpio cleaner than what? the android side I use is your original implementation so are you asking if his PR is cleaner than your original implementation? all I did in android is allow your original implementation to work in a mixed content environment |
My comment contains a link to the PR I referred to - @syonip created a similar PR for Android which uses a slightly different "design" for the special URL. |
The more important question to be able to understand and test your PR was this:
Can If this is true, am I correct that one could also describe this PR as to adding a special |
Does this feature work for WKWebView? Please note that WKWebView does not yet support NSURLProtocol (https://stackoverflow.com/questions/24208229/wkwebview-and-nsurlprotocol-not-working). Also, even though there is WKURLSchemeHandler, you cannot register a scheme handler for https. I have tried this patch in iOS device with WKWebView, and it doesn't appear to work for me. Has it worked for you at all? |
Same issue -- haven't been able to get this work on WKWebView. From a dev standpoint on IOS this is frustrating (and also due to how inconsistent the implementations are between platforms). Just about every major release the internal mechanism for serving files has changed without what feels like much consideration. |
I've gotten access to local files working in WKWebView using a WKURLSchemeHandler but the url schema has to be non http/https (e.g. cdvfile: works). |
Are you accessing cdvfile: from a "https" site? http should work fine, but https seems to throw [blocked] due to mixed-content (https to non-secure). |
I've been using https |
Has this pr been merged? |
@janpio using https://cdvfile will create CORS errors probably. better to use https://xxx.com/cdvfile where xxx.com is the site the browser is viewing and this way there are no CORS problems |
This is now also broken on Android Template 10 for cordova as that requires serving via https: cvdfile no longer works. Using a virtual folder is best due to CORS. Changing the hostname is not a good idea. Once this is merged the same thing should happen for Android to standardise. |
Currently if you load a remote https page (on domain xxx.com) on the ios webview then
cdvfile://...
urls requested from that page for active content such as js and css files are blocked by the mixed content policy.This PR solves this by allowing access to
cdvfile://localhost/bundle/www/cordova.js
using the url:https://xxx.com/cdvfile/bundle/www/cordova.js
Since this url is https and from same domain as the remote https page, this works!
Reference:
https://developer.mozilla.org/en-US/docs/Web/Security/Mixed_content#Mixed_passivedisplay_content
https://developer.mozilla.org/en-US/docs/Web/Security/Mixed_content/How_to_fix_website_with_mixed_content