diff --git a/lib/imgcache.js b/lib/imgcache.js index 659590d..fc3e3fe 100644 --- a/lib/imgcache.js +++ b/lib/imgcache.js @@ -190,7 +190,18 @@ LOG_LEVEL_ERROR = 3; // Returns a URL that can be used to locate a file Helpers.EntryGetURL = function (entry) { // toURL for html5, toURI for cordova 1.x - return (typeof entry.toURL === 'function' ? Helpers.EntryToURL(entry) : entry.toURI()); + var url = (typeof entry.toURL === 'function' ? Helpers.EntryToURL(entry) : entry.toURI()); + + // Ionics webview has a URL normalization method (#223) + var ionicNormalizer = window.Ionic && + ((window.Ionic.WebView && window.Ionic.WebView.convertFileSrc) || + window.Ionic.normalizeURL); + + if (typeof ionicNormalizer === "function") { + url = ionicNormalizer(url); + } + + return url; }; // Returns the full absolute path from the root to the FileEntry