brouter-web
brouter-web copied to clipboard
Downloading routes doesn't work with 3rd party browsers on iOS
- downloading a track (GPX, KML, GeoJSON) fails with 3rd part browsers (Firefox, Chrome, Brave, …) on iOS (tested with iOS 14.5)
- after tapping the export button nothing happens (besides from the progress bar which appears for a short moment)
- the CSV export is rendered as text file on the mentioned browsers
- everything works fine in Safari, the browser's download dialog appears for each file type, the download completes successfully after confirming the dialog:
- maybe related to Blob download doesn't work on iOS Chrome or Firefox (from 2020) or How to open Blob URL on Chrome iOS (from 2014)
(I'll investigate further, this issue is just a reminder that we have to fix this before creating the next release)
I forgot to mention that this is an issue with the new export functionality (68-sl-formatting
).
(I'll investigate further, this issue is just a reminder that we have to fix this before creating the next release)
Have you looked further into this?
The code section probably relevant here is this: https://github.com/nrenner/brouter-web/blob/5cc64015b966e0e5e9ae924e629e7f88a843d6a5/js/control/Export.js#L68-L75
It seems that this problem persists. Other projects have the same or similar issues, e.g. see this Stackoverflow thread.
Other references:
Thanks for the links, I also found:
Here is a minimal test page to reproduce (prints browser and feature checks and automatically starts a download):
I don't have access to an iOS device, but tested with a free account on LambdaTest with iPhone 11, iOS 13.3 and could confirm the issue with Firefox.
Several comments [1], [2], [3] suggest a workaround using FileReader.readAsDataURL(blob)
instead of URL.createObjectURL(blob)
, so here is a test page trying that:
Test results with LambdaTest:
- Firefox didn't work, shows progress bar but nothing else happens, Downloads are empty
- Chrome did work, downloads with name "document"
- Leaflet browser detections (
L.Browser.chrome/gecko
) didn't work, always detected as safari - iOS detection worked
Can you confirm that the fix page works in iOS Chrome but not in Firefox?
Can you confirm that the fix page works in iOS Chrome but not in Firefox?
Yes, I can confirm that.
Works in
- Safari
- Chrome
Doesn't work in:
- Firefox
- Brave
Tested with iOS 15.4.1 and latest versions of Chrome, Firefox and Brave.
Thanks for testing. Offering download from server as an alternative for now, currently for all as a fallback in case of other bugs.