Skip to content

Add the ability to share files #133

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

Merged
merged 2 commits into from
May 14, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 20 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
};
data-cite="FILEAPI">

This specification defines an API for sharing text, links and other
Expand Down Expand Up @@ -134,8 +134,17 @@

rejected with {{InvalidStateError}}.
  • If none of |data|'s members {{ShareData/title}},
  • {{ShareData/text}}, or {{ShareData/url}} are present, return a
    promise rejected with a {{TypeError}}.
    {{ShareData/text}}, or {{ShareData/url}} or {{ShareData/file}} are
    present, return a promise rejected with a {{TypeError}}.
  • If |data|'s {{ShareData/files}} member is present:
    1. If |data|'s {{ShareData/files}} member is empty, or if the
    2. implementation does not support file sharing, return a
      promise rejected with a {{TypeError}}, and abort these
      steps.
    3. If |data|'s {{ShareData/url}} member is [=dictionary
    4. member/present=]:
      Expand All @@ -157,6 +166,7 @@

    5. If the method call was not triggered by user activation,
    6. or a file type is being blocked due to security considerations,
      return a promise rejected with with a {{"NotAllowedError"}}
      {{DOMException}}.
      Expand Down Expand Up @@ -238,6 +248,7 @@

      dictionary ShareData {
      FrozenArray<File> files;
      Copy link
      Member Author

      Choose a reason for hiding this comment

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

      I think this should be a sequence, no? We wouldn't expect a developer to pass in a frozen array (i.e., {files: Object.freeze(filesArray)}).

      Suggested change
      FrozenArray<File> files;
      sequence<File> files;

      USVString title;
      USVString text;
      USVString url;
      Expand All @@ -248,6 +259,12 @@

      members:

      files member
      Files to be shared.
      title member
      Expand Down