-
Notifications
You must be signed in to change notification settings - Fork 760
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
Cordova 10 Android Template Serves via Https so cvdfile: webview access also no longer works here #512
Comments
I had a similar issue as a workaround I load the files into a blob and then attach the blob to the html view. Example code
|
This does not work when comming from https on Android or standard Android 10+ because localsrc will be file:// this is no longer allowed. Or am I missing something? |
I tested it on my pixel 5 phone with android 12 from an external https source without any issues. |
Bug Report
Cordova 10 Android Template Serves via Https so cvdfile: webview access also no longer works here. So upgrading to Android 10 template for cordova you can no longer access assets via cvdfile protocol urls still provided by the file plugin. This was previously a issue with web server based plugins like ionic-cordova-webview and others. But now it is a issue for the standard cordova template.
Problem
Whilst File access remains for our logging, html/browser access via cvdfile is broken. I've seen some attempts here to change from cvdfile protocol but all unsuccessfully merged. Keeping this protocol breaks in Android 10 template, has already caused endless issues with webview plugin and ios removal. Causes CORS issues, etc etc. I know the previous attempts changed the host. This would be wrong due to CORS, but that is a silly excuse to just do nothing. This plugin is basically one for the cornerstone cordova plugins that crosses the bridge for developing non-native/native. Hacky solutions claiming all access should now be javascript is wrong.
Best solution would be to become compatible with AndroidX and change the file path (if template > 10) to utilize a "virtual folder" for cvd access. It's not breaking any rules if the access is served via the current hosting mechanisms (wether ionic-webview OR Android Template > 10 without enabling legacy file mode).
I'm going to make this change and pull. Please assist with suggestions.
Information
To reproduce. Upgrade Cordova Android > 10. Access assets via cvdfile://.... either by requesting valid url from toNativeURL or toInternalURL. Neither can render either as file: or cvdfile: because you are comming from https.
Environment, Platform, Device
Android Cordova 10 template. Android 11 or below.
Version information
Ionic:
Ionic CLI : 6.18.1 (/Users/weareu/.nvm/versions/node/v16.13.1/lib/node_modules/@ionic/cli)
Ionic Framework : ionic1 1.3.5
@ionic/v1-toolkit : 3.2.15
Cordova:
Cordova CLI : 11.0.0
Cordova Platforms : android 10.1.1, ios 5.1.1
Cordova Plugins : no whitelisted plugins (41 plugins total)
System:
Android SDK Tools : 26.0.1 (/Users/weareu/Library/Android/sdk)
ios-deploy : 1.11.4
ios-sim : 8.0.2
NodeJS : v16.13.1 (/Users/weareu/.nvm/versions/node/v16.13.1/bin/node)
npm : 7.24.2
OS : macOS Monterey
Xcode : Xcode 13.2.1 Build version 13C100
Checklist
The text was updated successfully, but these errors were encountered: