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

Support for hashfragments in share target action #89

Open JeremyMahieu opened 4 years ago

JeremyMahieu commented 4 years ago

The use of '#!' in the share target action is not supported. But for (older) SPAs this would be usefull. The #! is usually a part of the routing but could be used for other extra information aswell.

"share_target": {
  "action": "/index.html/#!/share",
  "method": "GET",
  "params": {
    "title": "title",
    "text": "text",
    "url": "url"
  }
}
mgiuca commented 4 years ago

I think this is supported right now (weirdly, it looks like we override the query, but not the fragment), according to this algorithm.

Does the fragment get deleted in the actual implementation?

JeremyMahieu commented 4 years ago

I've tried with "action": "/#!/share", on android/chrome and it does not seem to route my app to the correct location. Wheras if I type in manually https://mydomain.com/#!/share it does route me to the correct page.

Don't take my word for it though, I'm not sure. There's a lot of caching going which is not ideal for testing.