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

Add the ability to share files #133

Merged
merged 2 commits into from
May 14, 2020
Merged

Add the ability to share files #133

merged 2 commits into from
May 14, 2020

Conversation

marcoscaceres
Copy link
Member

@marcoscaceres marcoscaceres commented Nov 6, 2019

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.
@@ -238,6 +248,7 @@ <h3>
</h3>
<pre class="idl">
dictionary ShareData {
FrozenArray&lt;File&gt; 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&lt;File&gt; files;
sequence&lt;File&gt; files;

@marcoscaceres
Copy link
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
Member

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

@marcoscaceres
Copy link
Member Author

marcoscaceres commented May 6, 2020

@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
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
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
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