-
Notifications
You must be signed in to change notification settings - Fork 214
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
Unsupported URL issue on WKWebView #223
Comments
Hi, so I assume that you are using the ionic wkwebview plugin. If thats the case here is a workaround for the problem: You need to install the cordova file plugin first.
Hope this fix your problem. |
I am facing th same issue, the solution suggested above is not working for me. |
Its not working for me when i use iosPersistentFileLocation as Library. Getting 404 error. |
@manishoswal can you please give an example about it? |
@owen2345 - You need to implement the changes suggested by gkTim on Sep 29 and also update the config.xml file to |
hey guys, I've fixed the problem. Here you can find an example |
It is not required do this conversion inside imgcache.js, but it is required to add code to edit the url that is received from imgcache.js otherwise. |
Any updates on this? Mistho's PR does not work for me, window.Ionic.normalizeURL doesn't change the url of type cdvfile//..., so the resulting url is still incompatible. |
To get a loadable url for both iOS and Android, I came up with the following solution, based on cordova-plugin-file documentation:
entry.toURL() will convert cdvfile:// url to a native path, i.e. an absolute file:// url. The ionicNormalizer will then normalize this url, e.g. to a localhost url. |
Sweet victory @jperez1111 you are the bomb!!! |
Fixed the problem using @jperez1111's reply and with some changes as mentioned in #237 (comment) |
Here is what I did to fix loading of images cached with ImgCache.js under WKWebView.
The resulting URL on iOS will be something like:
Note that it must start with /, not with cdvfile://, nor file://, nor http://localhost:8080/, nor anything else |
@jperez1111 awesome! Anything we have to do differently or modify if not using Ionic, to get this to work? |
@tryhardest sorry, I haven't used this library in any other context than with Ionic. |
Thank you so much, this is working for me |
The image caching works fine on ios app (cross platform) if we do not use cordova-plugin-ionic-webview as soon as we install this plugin i am getting the following error
Error - Failed to load resource: unsupported URL cdvfile://localhost/persistent/imgcache/adf3c56ed32d0fc3206e4adff2b608bad41aff38.png
The text was updated successfully, but these errors were encountered: