Closed xfalcox closed 6 years ago
Hi, it sounds like you have a Chrome issue, not an issue with the web standard. These should be reported to https://crbug.com/new.
Though I wonder if you've installed the app as a WebAPK (requires that it satisfies the PWA Checklist). Chrome for Android only lets installed PWAs register as share targets.
Closing the issue. If it is still a problem, please report on https://crbug.com/new.
Thanks for the reply @mgiuca!
Though I wonder if you've installed the app as a WebAPK
Yes, I did.
Hi, it sounds like you have a Chrome issue, not an issue with the web standard.
My question would be how to properly encode line breaks and &
in the web share url in the manifest.
Using the standard rails json encoder this:
"share_target": {
"url_template": "new-topic?title={title}&body={text}\n\n{url}"
}
becomes this:
"share_target": {
"url_template": "new-topic?title={title}\u0026body={text}%0A%0A{url}"
}
Is this a valid manifest, per the spec?
I was wondering why you had \u0026
and %0A%0A
in there. '\u0026'
and '&'
are exactly equivalent in JSON so that will be the same. '%0A'
and '\n'
should be equivalent per the URL standard. So that encoding that Rails is doing is fine, though it shouldn't be necessary.
I'm not sure why you want newlines in your URL. If you're trying to create a POST-style HTTP request body (by inserting two newlines), that won't work. This will just make a GET request with "%0A%0A" in the request header.
I don't see any reason, though, why this wouldn't be accepted as a valid web share target URL.
I'm not sure why you want newlines in your URL. If you're trying to create a POST-style HTTP request body (by inserting two newlines), that won't work. This will just make a GET request with "%0A%0A" in the request header.
This is a our URL at Discourse to create a new topic in Discourse:
https://meta.discourse.org/new-topic?title=title&body=text%0A%0Aurl
will produce:
I tested a sharing a bunch of stuff from different Android apps, and we don't always get url
and text
so I'm just adding both to our post text area separated by line breaks to help the user compose his topic.
However it's not being correctly detected by current Chrome Canary in the Android and I was afraid that one of those special characters were infringing the spec.
Ahh I see, sorry I completely missed the fact that the URL was part of the "body" parameter (I thought you were trying to do some weird HTTP thing). That makes sense and should work. Can you file a bug in https://crbug.com/new, and I'll try to look at it.
Note: We've recently discussed changing this to a new syntax which would not allow you to compose a parameter like that (you would only be able to set each query parameter to one of the share fields). I've written an analysis of this on a comment on that issue.
I can't get my webapp to show as a share target in the current Chrome Canary.
Here is the manifest:
https://meta.discourse.org/manifest.json