-
Notifications
You must be signed in to change notification settings - Fork 66
Should sharing zero size files be allowed? #229
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
Comments
Why would |
Gecko does not throw on |
Yeah, I realized after posting that it likely won't fail, but the blob will be empty so you won't end up sharing anything. |
Is just checking if the file is zero size sufficient? If yes, we could just add that check for each file (and return false). |
Alternative: filter out all zero length files. If results in empty list of files, return false. |
@tomayac, what do you think? Drop the empty files on the floor (and do nothing if they are all empty)? It seems like the most user friendly solution. |
An empty file still has some info (the filename) so I wonder implicitly filtering it out may add some confusion. |
Well, it depends. On MacOS's various handlers it's kinda confusing, because some apps just spin up with nothing to share (e.g., in Notes.app). The name doesn't seem to play a significant role. Others show an empty preview of a file. In Messages.app, for example: When normally you would see a preview: What happens on Windows? |
Ok, let's got with doing nothing here. Developer should decide and, if they so choose, filter out empty files for situations like @tomayac found. However, for certain applications (e.g., text), it could make perfect sense to share an empty text file with just a file name. |
Should sharing of an opaque response be allowed?
For this example,
navigator.canShare()
returnstrue
, but the actual share operation then fails. Play with this example deployed.Possibly related: #173
The text was updated successfully, but these errors were encountered: