Closed Maistho closed 7 years ago
do i still need to follow these steps ?
@FromBucketsToRainBarrels what steps?
Basically either:
imgcache.js
after installing.I'm sorry, I should be more specific.
should I add <meta http-equiv="Content-Security-Policy" content="default-src * 'unsafe-inline' 'unsafe-eval'; media-src *">
to my index.html ?
You'll always need to set an appropriate CSP. I would not set one that permissive.
Have a read and decide what would be a good fit for you:
I tested my appwith ionic serve
I am able to access the cached file at filesystem::http:// ..... as you can see in the screen shot above
I tested my appwith ionic browser serve --livereload
I get the file without any issue from the same location
then I upload my browser project onto my remote server and try to access it from there and I can not get my files, if you look at this screenshot below I checked if the imgchache.js has the return (typeof cordova !== 'undefined' || typeof phonegap !== 'undefined') && window.parent._cordovaNative;
changes that you made. and they are also there.
if you want to check the live example of my app running with the latest changes
I even tried to hack my way to get the cached file by changing the path "cdvfile://localhost/temporary/imgcache/65e41411723b32de1e9d6e79863fbd909a3034de.png"
to
"filesystem:http://localhost/temporary/imgcache/65e41411723b32de1e9d6e79863fbd909a3034de.png"
but still I get the same error
project repo url : https://github.com/FromBucketsToRainBarrels/weather_social_app travis-ci : https://travis-ci.org/FromBucketsToRainBarrels/weather_social_app
Well, ionic serve
does not create window.cordova
.
I looked at your live site, and it seems to work for me as long as I accept the request to store files. That being said, you should use a fallback if a user blocks the filesystem api, or is on a non-chrome browser.
Also, you don't seem to have the changes live on your site.
Regardless, your issues don't seem related.
yes, as you suggested, I removed the cordova.js file from my browser project for now. I spent too much time trying to get this to work last night. I re built the project and reverted those changes. I guess I'll add cordova.js file back to my browser project once your request is merged to the master. Thanks for helping on it. glad you replied, I would have had been stuck on it otherwise
Thanks a lot @Maistho , I don't follow the ionic platform at all, glad it solves something there.
This still does not fix the problem for me, in electron.
Here is the original
Helpers.EntryToURL = function (entry) { if (Helpers.isCordovaAndroidOlderThan4() && typeof entry.toNativeURL === 'function') { return entry.toNativeURL(); } else if (typeof entry.toInternalURL === 'function') { // Fix for #97 return entry.toInternalURL(); } else { return entry.toURL(); } };
It keeps returning entry.toInternalURL(); while what you need if you have loaded cordova.js (for the yummy plugins of course) is entry.toURL();
A simple junk fix that i have added is to check on the second conditional if it is actually cordova.
Helpers.EntryToURL = function (entry) { if (Helpers.isCordovaAndroidOlderThan4() && typeof entry.toNativeURL === 'function') { return entry.toNativeURL(); } else if (Helpers.isCordova() && typeof entry.toInternalURL === 'function') { // Fix for #97 return entry.toInternalURL(); } else { return entry.toURL(); } };
This works perfectly fine in electron.
fixes #159 fixes #160
also affects #164 ?
This sets the browser platform in cordova to be just a regular browser platform.