Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add workaround for cordova FileReader #622

Closed
wants to merge 1 commit into from

Conversation

vially
Copy link

@vially vially commented Jun 29, 2018

As mentioned in several other places, cordova-plugin-file is overwriting the FileReader with one that doesn't follow the spec.

This is arguably a problem with cordova-plugin-file. But since a fix doesn't seem to be very high on their priority list, maybe adding this temporary workaround for it to pannellum would be a good short term solution.

@jineshmehta16
Copy link

jineshmehta16 commented Jun 30, 2018

Hi Can this solution be Implemented for normal Ionic framework where pannellum is not included?

I am facing this issue in my Ionic project, I have tried to reorder cordova and polyfill javascripts still it didn't solve the problem. In my project panaroma is not required. So how can I address in this situation?

@vially
Copy link
Author

vially commented Jul 1, 2018

Can this solution be Implemented for normal Ionic framework where pannellum is not included?

This solution could not be implemented in Ionic because it would then break plugins which rely on the implementation of FileReader provided by the cordova-plugin-file plugin (e.g.: file-system access). The only place where this mess could be fixed properly would be in the cordova-plugin-file by either not overwriting the global FileReader object or at least overwrite it in a way that is 100% compatible with the spec.

In my project panaroma is not required. So how can I address in this situation?

Most probably you would have to patch the library that is using the FileReader API (most probably in a similar way to my patch here). But obviously that's not a good long-term solution because we can not expect that all the libraries that make use of the FileReader API implement a workaround just to be compatible with cordova-plugin-file.

@mpetroff
Copy link
Owner

mpetroff commented Jul 1, 2018

A fix might be low on their priority list, but it's not on mine at all. Mobile / app frameworks are not officially supported; I just added a note to the README to make this policy explicit. While I'll accept pull requests that make minor tweaks to fix compatibility with these frameworks, I'm not adding any code that specifically targets one of them (like this pull request does).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants