FEATURE: sharing link to PWA renders url in title in new Topic to leverage core link expansion #32631
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Discourse has a fantastic feature whereby when installed as PWA (on Android or Windows), you can share content to that Discourse from other apps and browsers.
Currently when sharing a link to a Discourse PWA, it pre-populates a draft Topic body with the link.
Whilst this is really nice already, we can improve this further. Currently, sharing a link to the body misses out on the auto-magic core feature of pasting a link in the title which simultaneously hydrates a title from the og tag and creates a one-box in the body.
This PR remedies this whilst carefully maintaining the current behaviour for text shares.
Documentation for the standard is here:
https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/How_to/Share_data_between_apps
Demo of this working change is implemented in this plugin:
https://github.com/merefield/discourse-share-to-link-oneboxer
I added a test to check presence of share target in manifest endpoint.