Intent to Ship: Web Share Level 2

102 views
Skip to first unread message

Eric Willigers

unread,
Apr 1, 2019, 2:46:39 PM4/1/19
to blink-dev

Contact emails

ericwi...@chromium.org, ray...@chromium.org


Explainer

https://github.com/WICG/web-share/blob/master/docs/explainer.md


Spec

https://wicg.github.io/web-share/level-2/


TAG Review - Web Share API

The API was most recently discussed during

TAG Review - Web Share Target API


Summary

We are adding the ability to share files, and a canShare() method for feature detection.


See Intent to Implement


Is this feature supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?

This is initially for Android only (same as Level 1). We use the platform native share dialog.


Demo link

https://jsfiddle.net/ericwilligers/8cpuskqd/ - obtains files from <input type="file">

https://jsfiddle.net/ericwilligers/7cory9mj/ - creates files using File API


(To test these on Android, merge CL 1460583 and enable the experimental Web Platform feature flag WebShareV2).

Risks

Security

Malicious sites might attempt to share malware.


For the initial implementation, we only allow sharing of files with extensions that are not considered potentially dangerous by Safe Browsing: images, videos and text.


In particular, we don't allow sharing of Android executables (.apk / .dex).


Interoperability and Compatibility

This feature was well received at the Web Platform Working Group discussion at TPAC 2018 (minutes).


Edge: No signals

Firefox: under consideration (discussion, bug). The canShare() method was requested by Marcos.

Safari: Level 1 of the Web Share spec (text and URL sharing) is implemented in Safari Preview.

Web developers: The ability to share images and files has been a consistent request, for example from authors of image editors.


See also the blink-dev Intent to Implement discussion for Level 1. Usage of Level 1 has been growing.


There have public articles about Web Share Level 1 by numerous authors:-



Ergonomics

The Web Share Target API complements this API. Web applications can register to receive share requests. It is implemented (but not shipped) in Chrome for Android.


Activation

The API is straightforward and feature detectable, developers should be able to make use of it immediately, without degrading the experience of users running older browsers.


Is this feature fully tested by web-platform-tests?

canShare() has Web Platform Tests.

share() calls a platform-specific dialog. Required failure cases have web platform tests.



Entry on the feature dashboard

Web Share API Level 2


Daniel Bratell

unread,
Apr 5, 2019, 8:15:55 AM4/5/19
to blink-dev, Eric Willigers
LGTM1

/Daniel
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAAyiQQO-MipRyoG5bii4ZQ2B3u8p6R4hUXN%2BeXxMQf%2B%3Dd1DKGw%40mail.gmail.com.



--
/* Opera Software, Linköping, Sweden: CET (UTC+1) */

Chris Harrelson

unread,
Apr 6, 2019, 5:23:43 PM4/6/19
to Daniel Bratell, blink-dev, Eric Willigers

Yoav Weiss

unread,
Apr 8, 2019, 7:22:08 AM4/8/19
to Chris Harrelson, Daniel Bratell, blink-dev, Eric Willigers
Reply all
Reply to author
Forward
0 new messages