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

[Web Share] Add list of usually shareable file types #11023

Merged
merged 6 commits into from
Dec 7, 2021
Merged

Conversation

tomayac
Copy link
Contributor

@tomayac tomayac commented Dec 7, 2021

Summary

Add note about Chromium's list of accepted file types for navigator.share().

Motivation

Questions about this keep coming up.

Supporting details

https://docs.google.com/document/d/1tKPkHA5nnJtmh2TgqWmGSREUzXgMUFDL6yMdVZHqUsg/edit

Metadata

  • Adds a new document
  • Rewrites (or significantly expands) a document
  • Fixes a typo, bug, or other error

Questions about this keep coming up.
@tomayac tomayac requested a review from a team as a code owner December 7, 2021 09:25
@tomayac tomayac requested review from Elchi3 and removed request for a team December 7, 2021 09:26
@github-actions github-actions bot added the Content:WebAPI Web API docs label Dec 7, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Dec 7, 2021

Preview URLs

Flaws

None! 🎉

External URLs

URL: /en-US/docs/Web/API/Navigator/share
Title: Navigator.share()
on GitHub

No new external URLs

(this comment was updated 2021-12-07 13:51:03.417087)

@Elchi3
Copy link
Member

Elchi3 commented Dec 7, 2021

This seems very useful but linking to a google doc makes me cringe a bit. Should we include a table with this information in the docs directly (in which we invite other browsers to talk about their accepted file types, too)?

@tomayac
Copy link
Contributor Author

tomayac commented Dec 7, 2021

I like this idea! Here's the Markdown for such a table. Please advise where this would go.

| Category    | Extension - `MIME type                           |
| ----------- | ------------------------------------------------ |
| Application |                                                  |
|             | `.pdf` - `application/pdf` (from Chromium 93)    |
| Audio       |                                                  |
|             | `.flac` - `audio/flac`                           |
|             | `.m4a` - `audio/x-m4a`                           |
|             | `.mp3` - `audio/mpeg` (also accepts `audio/mp3`) |
|             | `.oga` - `audio/ogg`                             |
|             | `.ogg` - `audio/ogg`                             |
|             | `.opus` - `audio/ogg`                            |
|             | `.wav` - `audio/wav`                             |
|             | `.weba` - `audio/webm`                           |
| Image       |                                                  |
|             | `.bmp` - `image/bmp`                             |
|             | `.gif` - `image/gif`                             |
|             | `.ico` - `image/x-icon`                          |
|             | `.jfif` - `image/jpeg`                           |
|             | `.jpeg` - `image/jpeg`                           |
|             | `.jpg` - `image/jpeg`                            |
|             | `.pjp` - `image/jpeg`                            |
|             | `.pjpeg` - `image/jpeg`                          |
|             | `.png` - `image/png`                             |
|             | `.svg` - `image/svg+xml`                         |
|             | `.svgz` - `image/svg+xml`                        |
|             | `.tif` - `image/tiff`                            |
|             | `.tiff` - `image/tiff`                           |
|             | `.webp` - `image/webp`                           |
|             | `.xbm` - `image/x-xbitmap`                       |
| Text        |                                                  |
|             | `.css` - `text/css`                              |
|             | `.csv` - `text/csv`                              |
|             | `.ehtml` - `text/html`                           |
|             | `.htm` - `text/html`                             |
|             | `.html` - `text/html`                            |
|             | `.shtm` - `text/html`                            |
|             | `.shtml` - `text/html`                           |
|             | `.text` - `text/plain`                           |
|             | `.txt` - `text/plain`                            |
| Video       |                                                  |
|             | `.m4v` - `video/mp4`                             |
|             | `.mp4` - `video/mp4`                             |
|             | `.mpeg` - `video/mpeg`                           |
|             | `.mpg` - `video/mpeg`                            |
|             | `.ogm` - `video/ogg`                             |
|             | `.ogv` - `video/ogg`                             |
|             | `.webm` - `video/webm`                           |

@Elchi3
Copy link
Member

Elchi3 commented Dec 7, 2021

It seems important enough that I'd create a new h2 before the "Examples" section like so:

Shareable file types

table

Examples

...

And instead of your note with the google doc link, something like this:

  • files: An array of {{domxref("File")}} objects representing files to be shared. See below for shareable file types.

Copy link
Member

@Elchi3 Elchi3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Danke! 👍

@Elchi3 Elchi3 merged commit 726914f into mdn:main Dec 7, 2021
@Elchi3 Elchi3 changed the title [Web Share] Add note about Chromium's list of accepted file types [Web Share] Add list of usually shareable file types Dec 7, 2021
@tomayac tomayac deleted the patch-12 branch December 7, 2021 14:04
@tomayac
Copy link
Contributor Author

tomayac commented Dec 7, 2021

Woohoo, thanks for the review and making this even better!

Viele Grüße aus Hamburg!

The following is a list of usually shareable file types. However, you should always test with {{domxref("navigator.canShare()")}} if sharing would succeed.

- Application
- `.pdf` - `application/pdf` (from Chromium 93)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Elchi3 FWIW Little concerned that the list might end up being "Chromium" specific, and yet one more list of things that has to be kept updated outside of BCD. Maybe remove the "(from Chromium 93)."

I wonder if this list is just "all the media types you can play/use on the platform". I wonder what the things you can't send are? If so, we might be better off saying "Generally most media and text files that can be played on the platform can also be shared".

The following is a list of usually shareable file types. However, you should always test with {{domxref("navigator.canShare()")}} if sharing would succeed.

- Application
- `.pdf` - `application/pdf` (from Chromium 93)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `.pdf` - `application/pdf` (from Chromium 93)
- `.pdf` - `application/pdf`

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Content:WebAPI Web API docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants