Fix importing servers in Firefox for Android #1135
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #1130
This PR changes the import servers file input from
accept="text/csv"
to"aceppt=".csv"
.The reason is that, with the former, Firefox for Android would not allow picking valid CSV files if they have spaces in their name.
The solution is not perfect, as now Firefox for Android allows to pick any file, but that's because it does not really support the
accept
attribute in file inputs. See https://caniuse.com/?search=input%20type%20file%20acceptWith this change, Chrome for Android also allows to pick any file, but that was already its behavior before.
On desktop browsers the filtering works as expected, with the only limitation that you no longer can pick CSV files that don't have the CSV extension, and you can pick non-CSV files if they have the csv extension. But those are probably edge cases.
In any cases, Shlink handles the parsing of the file and displays a proper error message if an invalid file is picked, so this should put us in a better situation.