Skip to content

Commit c5d76d5

Browse files
troubleshooting error
1 parent 6d1a828 commit c5d76d5

File tree

2 files changed

+9
-17
lines changed

2 files changed

+9
-17
lines changed

www/Entry.js

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,6 @@ function Entry (isFile, isDirectory, name, fullPath, fileSystem, nativeURL) {
5252
this.fullPath = fullPath || '';
5353
this.filesystem = fileSystem || null;
5454
this.nativeURL = nativeURL || null;
55-
56-
if (this.nativeURL) {
57-
// todo move to fileSystem like the toInternalUrl
58-
/*if (window && window.WkWebView) { // https://github.com/apache/cordova-plugin-file/pull/457/commits/fea030f4e870ad7a2f07a8063c7da894ee9b2818
59-
this.nativeURL = window.WkWebView.convertFilePath(this.nativeURL);
60-
}*/
61-
}
6255
}
6356

6457
/**
@@ -198,10 +191,6 @@ Entry.prototype.toInternalURL = function () {
198191
*/
199192
Entry.prototype.toURL = function () {
200193
if (this.nativeURL) {
201-
// todo move to fileSystem like the toInternalUrl as above
202-
/*if(window && window.WkWebView) { // https://github.com/apache/cordova-plugin-file/pull/457/commits/fea030f4e870ad7a2f07a8063c7da894ee9b2818
203-
return window.WkWebView.convertFilePath(this.nativeURL);
204-
}*/
205194
return this.nativeURL;
206195
}
207196
// fullPath attribute may contain the full URL in the case that

www/ios/FileSystem.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,16 @@ FILESYSTEM_PROTOCOL = 'cdvfile';
2424
module.exports = {
2525
__format__: function (fullPath, internalUrl) {
2626
// todo move to fileSystem like the toInternalUrl as above
27-
console.log('__format__', fullPath, internalUrl);
28-
if(internalUrl && window && window.WkWebView) { // https://github.com/apache/cordova-plugin-file/pull/457/commits/fea030f4e870ad7a2f07a8063c7da894ee9b2818
29-
var convertedFilePath = window.WkWebView.convertFilePath(internalUrl);
30-
console.log('convertedFilePath', convertedFilePath);
27+
console.error('__format__', fullPath, internalUrl);
28+
var path = ('/' + this.name + (fullPath[0] === '/' ? '' : '/') + FileSystem.encodeURIPath(fullPath)).replace('//', '/');
29+
var cdvFilePath = FILESYSTEM_PROTOCOL + '://localhost' + path;
30+
31+
if (cdvFilePath && window && window.WkWebView) { // https://github.com/apache/cordova-plugin-file/pull/457/commits/fea030f4e870ad7a2f07a8063c7da894ee9b2818
32+
var convertedFilePath = window.WkWebView.convertFilePath(cdvFilePath);
33+
console.error('convertedFilePath', cdvFilePath, convertedFilePath);
3134
return convertedFilePath;
3235
}
33-
var path = ('/' + this.name + (fullPath[0] === '/' ? '' : '/') + FileSystem.encodeURIPath(fullPath)).replace('//', '/');
34-
return FILESYSTEM_PROTOCOL + '://localhost' + path;
36+
37+
return cdvFilePath;
3538
}
3639
};

0 commit comments

Comments
 (0)