breautek commented on issue #1053: URL: https://github.com/apache/cordova-android/issues/1053#issuecomment-680870465
> Thanks for your answer. The problem is not the path. Apparently the webview blocks the loading of local graphics into the html img src You're right, you were using a particular part of the feature that I wasn't really familiar with. I just tested this on `cordova-android@9` targeting API 29. I have an image file inside `cordova.files.dataDirectory + 'files/test.png';` Which when I use `toInternalURL()`, it gives me `cdvfile://localhost/persistent/test.png` path. This works when used in the DOM, for as long as I update the CSP appropriately. For me, my [fs root](https://github.com/apache/cordova-plugin-file#cdvfile-protocol) appears to be `persistent`, while your URL seems to have an fs root of `files` If I change `persistent` to files, I do not receive the `ERR_UNKNOWN_URL_SCHEME`, but I do get a 404 Not found. I did receive `ERR_UNKNOWN_URL_SCHEME` if I use other `localhost/x` paths. After moving the test image file to the proper place using `adb shell`, I see the `cdvfile://localhost/files/...` works properly for me. I then created a sub directory and copied the image file, and determine it still works. I then changed the `AndroidExtraFileSystems` defaults to omit the `files` file-system using: `<preference name="AndroidExtraFilesystems" value="files-external,documents,sdcard,cache,cache-external,assets,root" />` This is when I reproduced your issue. So I would check the `AndroidExtraFilesystems` preference and ensure you are including `files` ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
