Chrome Version: 61
OS: All
What steps will reproduce the problem?
On Windows/Chrome OS/Linux:
(1) Turn on --enable-experimental-web-platform-features
(2) Go to https://wicg.github.io/web-share-target/demos/sharetarget.html and register according to the instructions there.
(3) Open the JavaScript console. Type "navigator.share({})".
What is the expected result?
"Title shared: null"
URL does not contain a "title" param.
What happens instead?
"Title shared:"
URL contains "title=".
Details:
The Mojo ShareService interface:
Share(string title, string text, url.mojom.Url url) => (ShareError error);
Should be:
Share(string? title, string? text, url.mojom.Url? url) => (ShareError error);
All three of these fields are optional in the IDL. Currently, if a field is omitted, it is transmitted via Mojo as an empty string, which is not ideal, and leads to the above user-visible minor bug.
This does not affect the specified behaviour of Web Share (more affects Web Share Target).
Comment 1 by mgiuca@chromium.org
, Jun 16 2017Oh wait, of course, we can't actually get rid of those query parameters, because they are part of the URL template in the target (which we don't control). For example, if the target template is "title={title}&text={text}", we can't just decide to delete the entire "title=" bit if the title field is omitted. We can still change the Mojo interface but it won't have any practical (noticeable) effect, so low priority.