-
Notifications
You must be signed in to change notification settings - Fork 57
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
Web Share Target API #221
Comments
FYI our intent to ship is only currently blocked on TAG review and we'd like to not bypass this step, so would really appreciate a review ASAP. |
So a few thoughts so far (in somewhat random order):
|
Maybe a bigger issue here is thinking about what the path forward for better integration with both newer (mobile-focused) operating systems and older desktop-focused operating systems is. On desktop operating systems, there's often a mechanism for registration and handling of file MIME types, but |
Oh, and a final comment related to registries: it seems like there ought to be a master list somewhere of the extensions to WebAppManifest (and, for that matter, other uses of WebIDL |
There's also already a standard syntax for URL templates: https://tools.ietf.org/html/rfc6570 (with several npm module implementations) suggest we re-use that rather than reinventing the wheel there. |
Hi David, Thanks for the write-up. Sorry it's been awhile. I have been dealing with the URL escaping issue which is blocking the WST spec.
I think this is out of scope here (as you say, WST is consistent with the rest of the Manifest API). FWIW, this has caused some trouble already (we've talked about APIs that share the IDL dictionaries in the Manifest spec, and the issue came up that we would need to modify the IDL spec to automatically convert between underscore and camel-case because underscores would be unacceptable in JavaScript APIs). Well that never eventuated, but it is annoying. I think it's too late to not add underscores to Manifest members.
Yes. I don't want this right now, but we need to make sure it can be extended into this. There's a proposal for Web Share to be able to share blobs. This has been a big feature request for WST also (mostly, receiving images). I think they would come in through the same mechanism; a Blob would be created in the document context containing the file, and then a new field would be added to the ShareData (and thus, come in as a URL parameter) referencing the Blob URL. We can also filter by MIME type by adding new parameters to the share_target dictionary (which currently has just one field; it’s designed to be extended). I think the existing WST proposal can be extended into this later.
So @annevk and I have been talking on w3c/web-share-target#31 about parsing the template. It looks like we want to pre-parse the template at manifest parse time (resolving the relative URL before substituting template parameters), and that would address the above issue. The downside of this is it appears we need to change the syntax from "{text}" to "%(text)". I'm hesitant about this because of @plinss comment (I'll address below).
The path is ... unfortunate, but it looks like we'll have to limit this to query and fragment only.
Processing a query string is pretty fool-proof. We will automatically escape '=' and '&' and any other reserved characters, so as long as the receiver processes the query by: 1. Splitting on '&', 2. Splitting those parameters on '=' to a key,value pair, 3. Decoding percent-escapes... then any arbitrary string can be handled correctly. As you say, this is the same as a form submission, so all web sites need to be able to handle this.
It does: see Step 1.7 of the replace placeholders algorithm: "Replace each character of value, c, with the result of UTF-8 percent encoding c using the userinfo percent-encode set." However, I've recently discovered that this is wrong. The userinfo percent-encode set doesn't encode nearly enough characters (notably '&' and '+'). I've been looking into exactly how to define this properly for the past week in whatwg/url#369. It's complicated, but I basically want to define it as "the complement of the unreserved set from RFC 2896". (That is, the same algorithm as
It’s harder on a system without a native intent system. There are a couple of answers (unfortunately some of these overlap with one another):
I think we can avoid this by simply standardizing this into the Web App Manifest spec. At the moment, it makes sense for it to be its own separate spec, but if we do put this on a standards track, I would expect it to be merged into that spec, so we don’t need to keep track of a list of extensions.
Yikes! I wasn’t aware of this. It certainly looks relevant (just “Level 1” specifically). And coincidentally, it’s the exact syntax we settled on before the proposed syntax change in w3c/web-share-target#31. There’s just one problem: we reference the URL Standard, not RFC 3986, for our definition of a URL and URL processing. (This seems to be true of all new web standards.) I don’t see how to reconcile RFC 6570 with URL Standard. Aside from URL Standard compatibility, there are a few other problems with this:
Still, this gives me renewed interest in keeping the |
Discussing today with @plinss at the W3C TAG meeting in London. One discussion point regarding RFC 6570 and the timing of resolution, it seems that perhaps one way out of this pickle would be to drop the URL-only version and double-down on the Is there a compelling reason to continue down the URL-only path, particularly given that many (I hope most!) Share Target implementations will happen via PWA installability (which already requires a SW)? /cc @mgiuca |
Yes, if we went with the Service Worker approach, we side-step the entire issue of URL template syntax, since it's coming in through a JavaScript object (essentially it would be a ShareData object from Web Share). Initially, we were considering these two approaches in parallel, but we stopped considering the Service Worker approach a long time ago, for a number of fairly compelling reasons:
Basically, simplicity trumps flexibility. I'd rather stick with the URL approach. Also (and this shouldn't be a particularly strong argument when considering a web standard, but I'll say it), we have working implementations on Chrome for both mobile and desktop, as well as websites like Twitter that have implemented it. |
Services like Pocket seem like a notable counterexample here, based on my experience using Android's share functionality. Is there a plan for such services in the web share target world? |
Yes, the "save for later" style of sharing is the one use case we've identified for receiving a service worker event rather than opening a page. But it is a soft requirement. You certainly could show a tab that says "I've saved this for later [Close]." Or "Do you want to save this for later? [Save] [Cancel]".
Yes, the Service Worker navigate event. (Edit: Full site with explainer and demo.) |
David and Alex will attempt to meet with mgiuca to discuss further offline |
Sounds good. Let me know a time and I'll try to make it. 9am to 6pm weekdays Sydney time are best (if you are in the USA, this means afternoon/evening Sunday to Thursday). (Can email my GitHub username at chromium.org.) |
@ewilligers: I think it's best to not post uncommitted versions of the spec to personal GitHub pages, since the versioning can get confusing (it's unstable since at any time, it reflects an unknown revision of an unknown branch). The latest pull request is w3c/web-share-target#40, with a preview here including the big red disclaimer that this is a preview. It has gone through several rounds of code review since the document @dbaron is talking about (including addressing several of the concerns you raised). But it doesn't include the files part. Eric, perhaps you could create PRs for the "files" versions of these specs and then link to the Preview page instead of to your GitHub? Note that we aren't planning to roll file sharing into the first version of Web Share Target. We're just thinking about it so we have a good model to extend into. The initial version of WST will more or less look like the above preview.
The new version addresses this.
The new version addresses this. Specifically, the "MUST" requirement on the "action" member has been removed, since it was effectively an informative note. (Processing steps elsewhere say exactly what happens in this case.) I agree, that "MUST" should be reserved for conformance requirements on the processor (the user agent), not the content (the document); there isn't anything that content "MUST" do; rather, the standard describes how the processor handles all inputs.
This was added in Eric's (not yet committed) file sharing version, as a way of allowing for feature detection of the files feature. See a long discussion on whatwg/webidl#107. Without it, you wouldn't be able to know whether you're going to be able to share a file without actually trying it. This is a very rough sketch at this stage. It probably should return a Promise.
This is something we're actively talking about with the Chrome storage team who are trying to build on those file specs, and considering whether to try to resuscitate them or build something new. In summary, let's not get too caught up on the file sharing details of Eric's private branch. We are not launching those features any time soon (in Chrome) and do not plan to land them in the spec soon either. We just want to make sure there is a reasonable model to expand into file sharing territory later. We want the TAG review to focus on the title/text/URL share target which is currently in preview but will hopefully soon land in the WICG draft. |
This was discussed a bit today and @dbaron will look more closely at the version you just posted in the last comment, @mgiuca. That said, I'm confused about the use of |
We are proposing to initially ship only the title/text/URL share target, without files.
I hadn't considered this. The proposal was to exclusively support The intention for |
@slightlyoff This raises a really good point. We've been thinking about I don't think we should mandate However, I now think we should support |
Note: need to checkout the correct draft: http://wicg.github.io/web-share-target |
window.location is simpler, and works fine given the stringifier on the Location interface. This makes the example slightly simpler. I got here from w3ctag/design-reviews#221.
The definitions of the `title` and `text` members of `ShareTargetParams` were swapped; this associates the correct definition with the correct member. I got here from w3ctag/design-reviews#221.
The algorithm for appending to a header list accepts a name/value pair. It seems like the / separating the pair shouldn't be in the <code> element enclosing the name. I got here from w3ctag/design-reviews#221.
OK, I had a look at the correct version this time. I filed three pull requests (see above), and also have a few comments: It seems like it might be worth a non-normative note explaining future expansion plans for images/files (and their being POST-only) if that part of the spec isn't going to be written soon, just so it doesn't get forgotten and so somebody else could pick it up later. Two of the comments in #221 (comment) still seem to apply:
and (for both specs):
Otherwise things look good to me, at least after one read-through. |
I agree — we could have a section similar to my Extensibility of this API section in Web Share, but I got some negative feedback on this in w3c/web-share#61.
Aren't the descriptions in
I think that will be relevant when we introduce file sharing, but not for the initial version of the spec which doesn't include file sharing. |
I think not quite -- since they give me the feeling that I'm missing some description elsewhere. I think it's useful to state that it's basically an arbitrary set of data possibly coming from an OS sharing system or possibly coming from Web Share. |
Hey all, Discussed at today's F2F; we're excited by the direction this spec is taking, so are closing this issue and looking forward to hearing from y'all if/when there are other issues that arise that we can advise on. As a parting note, it would be great to see expanded examples, particularly ones that demonstrate how to deal with files and the Thanks again for working with us! |
Thanks @slightlyoff and @dbaron! I'm filing issues about these things you raised: |
Hi @mgiuca just following this up. I noticed this behaviour working in WebAPK based webapps recently. However it doesn't look like this has percolated back into the webapp manifest specification. Is there a plan to bring this back to the webapp manifest spec itself? |
Hello TAG!
I'm requesting a TAG review of:
Further details (optional):
You should also know that...
Questions for the review panel:
"/foo/{text}."
, if the text supplied is ".." then it would be a path escape. Not sure how to resolve this; escaping doesn't help because the URL Standard explicitly says that "%2e%2e" also means parent directory. The easiest solution is to simply prevent placeholders from appearing before the '?' (so they have to be in the query or fragment).We'd prefer the TAG provide feedback as (please select one):
Thanks and feel free to post any follow-up discussion questions here.
The text was updated successfully, but these errors were encountered: