Use FileReader in macOS native apps using WebKit#613
Conversation
|
I have a similar issue where Like this: I suggest the isWebkit check is done before trying to find 'download', as isWebKit is a boolean that has already been calculated, so no need to perform the |
Hello @Floriferous I have submitted a PR to fix the problem in node environments since my tests were failing even if not trying to test FileSaver at all #620 620 |
|
@eligrey will do. Do you want me to rebuild the dist as well? |
|
Yeah, you should also re-build dist. Make sure that you also maintain compatibility with iOS as per #577. I don't have an iOS device to test. Thanks for taking the time to PR! |
|
@eligrey just tested, still works on iOS Chrome |
Using isWebKit before isSafari could cause Safari to use FileReader even if force === false, since the user agent for Safari also includes AppleWebKit
Includes eligrey/FileSaver.js#613, which fixes an issue on macOS when exporting SeedVaults
In a macOS native app that uses WebKit, calling
saveAson aBlobattempts to open the blob URL. This results in a message that saysThere is no application set to open the URL blob:http...(see iotaledger-archive/spark-wallet#89 (comment)).As in Safari, the
FileReaderAPI should be used. However, changes need to be made to the browser detection because of a few differences between Safari and WebKit:HTMLAnchorElement.downloadis definedtypeof FileReaderreturns'function'instead of'object'With these changes, the expected behavior is achieved:
Fixes #509