diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d207d8c64..16f8fa563 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -58,4 +58,4 @@ jobs: - uses: codecov/codecov-action@v1 with: - fail_ci_if_error: true + fail_ci_if_error: false diff --git a/tests/tests.js b/tests/tests.js index 7609738d8..1293ca37a 100644 --- a/tests/tests.js +++ b/tests/tests.js @@ -3832,16 +3832,18 @@ exports.defineAutoTests = function () { expect(entry.name).toCanonicallyMatch('logo.png'); expect(entry.fullPath).toCanonicallyMatch('/www/img/logo.png'); expect(entry.filesystem.name).toEqual(cdvfileApplicationDirectoryFsRootName); - + var internalURL = entry.toInternalURL(); + expect(internalURL).toEqual('wrong', 'It should be an internalUrl what is it?' + internalURL); var img = new Image(); // eslint-disable-line no-undef img.onerror = function (err) { + console.error('Current error', err); expect(err).not.toBeDefined(); done(); }; img.onload = function () { done(); }; - img.src = entry.toInternalURL(); + img.src = internalURL; }, failed.bind(null, done, 'resolveLocalFileSystemURL failed for cdvfile applicationDirectory')); }, failed.bind(null, done, 'resolveLocalFileSystemURL failed for cdvfile applicationDirectory')); }); diff --git a/www/ios/FileSystem.js b/www/ios/FileSystem.js index cb14c783f..f1d491709 100644 --- a/www/ios/FileSystem.js +++ b/www/ios/FileSystem.js @@ -22,8 +22,17 @@ FILESYSTEM_PROTOCOL = 'cdvfile'; module.exports = { - __format__: function (fullPath) { + __format__: function (fullPath, internalUrl) { + console.error('__format__', fullPath, internalUrl); var path = ('/' + this.name + (fullPath[0] === '/' ? '' : '/') + FileSystem.encodeURIPath(fullPath)).replace('//', '/'); - return FILESYSTEM_PROTOCOL + '://localhost' + path; + var cdvFilePath = FILESYSTEM_PROTOCOL + '://localhost' + path; + + if (cdvFilePath && window && window.WkWebView) { // https://github.com/apache/cordova-plugin-file/pull/457/commits/fea030f4e870ad7a2f07a8063c7da894ee9b2818 + var convertedFilePath = window.WkWebView.convertFilePath(cdvFilePath); + console.error('convertedFilePath', cdvFilePath, convertedFilePath); + return convertedFilePath; + } + + return cdvFilePath; } };