w3c / web-share-target

Web API proposal for receiving shared data
https://w3c.github.io/web-share-target/
Other
191 stars 20 forks source link

Omit field that is not present in ShareData, rather than setting it to empty string #45

Closed mgiuca closed 6 years ago

mgiuca commented 6 years ago

Currently, if a field is missing from the ShareData, it is set to the empty string (note that if the field is missing from the "params" in the manifest, it is omitted entirely; this is about if the field is present in the manifest but not in the share data payload). This means the target app cannot distinguish between data being omitted and being the empty string.

I think this is a hold-over from the URL template version. There's no reason to do this now. We should just omit the key/value pair if the field is not present in ShareData.

The line in Launching the web share target:

If value is undefined, set value to an empty string.

would become

If value is undefined, then continue.