Sharing a post in mobile Chrome returns root URL

I have noticed this recently that when i open a post on Discourse in mobile Chrome (Android) and try to share it using browser’s Share menu and select say Outlook or Message or other app, it always relays the root URL of discourse (e.g. https://discourse.domain.org) instead of an URL of an actual post i want to share.

1 Like

Just to clear it up:

  • post share works fine, uses native web share API

  • post timestamp works fine, open discourse tooltip with current URL.

Clicking the browser 3 dots menu and then clicking share fails, Chrome Android has a new “feature” since version 64 and will use the page canonical for sharing. We only generate the canonical server side, so it isn’t updated on SPA navigation. The Android share menu feature will be stuck into the first loaded page.

This appears to be broken since Chrome 64 release in 2019-01-23T02:00:00Z, so it’s not something heavily used. Mostly because we provide post level sharing buttons using the same API who are easily accessible and more precise. Users in PWA mode also don’t have access to 3 dots menu.

A fix would mean calculating and updating canonicals also client side which is some nasty duplication that will eventually drift. Other strategy would be requesting a canonical from the server on every response.

4 Likes

Thank you for the info. I know that i can use Discourse’s sharing option, but i am too used to use browser’s option, because i use it with any web page. It’s not that critical and i don’t use it that much with Dicourse, as i have only noticed it recently. But would be nice to have it working again.

1 Like

This was fixed by @pmusaraj

https://github.com/discourse/discourse/pull/11699/files

4 Likes

This topic was automatically closed after 47 hours. New replies are no longer allowed.

Re-opening this as it was reported a regression on this fix.

3 Likes