Skip to content

Add the ability to share files - #133

Merged
marcoscaceres merged 2 commits into
masterfrom
file
May 14, 2020
Merged

marcoscaceres merged 2 commits into
masterfrom
file

Conversation

@marcoscaceres

@marcoscaceres marcoscaceres commented Nov 6, 2019 •

Copy link
Copy Markdown
Member

Add a files member to ShareData dictionary.

@ericwilligers, I tried to add in what is in level 2 to kick off discussion.

For normative changes, the following tasks have been completed:

Implementation commitment:

Add a `files` member to ShareData dictionary.
Comment thread index.html
</h3>
<pre class="idl">
dictionary ShareData {
FrozenArray&lt;File&gt; files;

Copy link
Copy Markdown
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&lt;File&gt; files;
sequence&lt;File&gt; files;

@marcoscaceres

Copy link
Copy Markdown
Member Author

@hober, during TPAC you mentioned that this may be of interest to the WebKit community. Would you be the right person to help us with reviewing/designing this extension to web share?

@othermaciej

Copy link
Copy Markdown
Member

There's code implementing file sharing now in WebKit trunk, see: https://bugs.webkit.org/show_bug.cgi?id=207491

@marcoscaceres

marcoscaceres commented May 6, 2020 •

Copy link
Copy Markdown
Member Author

@othermaciej, that's fantastic news! thanks for the update.

Were you folks ok with the way .canShare() works? I'd made an alternative proposal in #108? Happy to close it that if WebKit will follow Chrome's behavior tho.

@othermaciej

Copy link
Copy Markdown
Member

We've currently implemented more or less what is in the spec. However, it's not too late to change what we have before it ships in a non-preview release.

I personally think the change proposed in issue #108 would be an improvement. I think canShare at one point checked for support of sharing specific file types, but now effectively just checks whether file sharing is supported. It seems unwieldy to construct a full ShareData just to check that. One downside is that a method with the same name but different parameters would be maximally likely to cause a compat issue if any content has adopted this AP. I'll comment to that effect in the issue.

@marcoscaceres

Copy link
Copy Markdown
Member Author

Sent a PR to WPT so the corresponding test is no longer be tentative.

Filed Gecko bug. I'll see if I, or someone on Mozilla's DOM Team, can find time to implement it.

@marcoscaceres

Copy link
Copy Markdown
Member Author

@ericwilligers, @mgiuca, this is probably ready to land I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants