diff --git a/package.json b/package.json index 56df32f4a..9d6b314ea 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cordova-plugin-file", - "version": "6.0.3-dev", + "version": "6.0.4", "description": "Cordova File Plugin", "types": "./types/index.d.ts", "cordova": { diff --git a/plugin.xml b/plugin.xml index 01bff31f6..22c68c00a 100644 --- a/plugin.xml +++ b/plugin.xml @@ -21,12 +21,12 @@ + version="6.0.4"> File Cordova File Plugin Apache 2.0 cordova,file - https://github.com/apache/cordova-plugin-file + https://github.com/jammer99/cordova-plugin-file https://github.com/apache/cordova-plugin-file/issues diff --git a/src/browser/FileProxy.js b/src/browser/FileProxy.js index 17955b686..3c571ddd6 100644 --- a/src/browser/FileProxy.js +++ b/src/browser/FileProxy.js @@ -29,7 +29,7 @@ // For chrome we don't need to implement proxy methods // All functionality can be accessed natively. - if (require('./isChrome')()) { + if (cordova.platformId === 'browser' && require('./isChrome')()) { var pathsPrefix = { // Read-only directory where the application is installed. applicationDirectory: location.origin + '/', // eslint-disable-line no-undef diff --git a/www/DirectoryReader.js b/www/DirectoryReader.js index 73669533c..5a86172f1 100644 --- a/www/DirectoryReader.js +++ b/www/DirectoryReader.js @@ -25,7 +25,7 @@ var FileError = require('./FileError'); /** * An interface that lists the files and directories in a directory. */ -function DirectoryReader (localURL) { +function DirectoryReader(localURL) { this.localURL = localURL || null; this.hasReadEntries = false; } @@ -46,6 +46,12 @@ DirectoryReader.prototype.readEntries = function (successCallback, errorCallback var win = typeof successCallback !== 'function' ? null : function (result) { var retVal = []; for (var i = 0; i < result.length; i++) { + var fs; + if (typeof result[i].filesystem !== 'undefined') { + fs = result[i].filesystem.name; + } else { + fs = result[i].filesystemName; + } var entry = null; if (result[i].isDirectory) { entry = new (require('./DirectoryEntry'))(); @@ -56,7 +62,7 @@ DirectoryReader.prototype.readEntries = function (successCallback, errorCallback entry.isFile = result[i].isFile; entry.name = result[i].name; entry.fullPath = result[i].fullPath; - entry.filesystem = new (require('./FileSystem'))(result[i].filesystemName); + entry.filesystem = new (require('./FileSystem'))(fs); entry.nativeURL = result[i].nativeURL; retVal.push(entry); }