From 7334071c22bf691cc7f69b6268c685e5c9fd3690 Mon Sep 17 00:00:00 2001
From: Eric Willigers
Date: Wed, 6 Nov 2019 22:51:01 +1100
Subject: [PATCH] Add the ability to share files
Add a `files` member to ShareData dictionary.
---
index.html | 23 ++++++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)
diff --git a/index.html b/index.html
index ce032c9..f95f14e 100644
--- a/index.html
+++ b/index.html
@@ -32,7 +32,7 @@
};
-
+
This specification defines an API for sharing text, links and other
@@ -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:
+
+ - If |data|'s {{ShareData/files}} member is empty, or if the
+ implementation does not support file sharing, return a
+ promise rejected with a {{TypeError}}, and abort these
+ steps.
+
+
If |data|'s {{ShareData/url}} member is [=dictionary
member/present=]:
@@ -157,6 +166,7 @@
If the method call was not triggered by user activation,
+ or a file type is being blocked due to security considerations,
return a promise rejected with with a {{"NotAllowedError"}}
{{DOMException}}.
@@ -238,6 +248,7 @@
dictionary ShareData {
+ FrozenArray<File> files;
USVString title;
USVString text;
USVString url;
@@ -248,6 +259,12 @@
members:
+ -
+ files member
+
+ -
+ Files to be shared.
+
-
title member