This is a good idea. It’d be neat to get fediverse services, including lemmy, supporting this. We could make cross site interactions so much easier.
There are a couple share project listed on https://delightful.club/delightful-activitypub-development/
I’m probably missing something, but wouldn’t it be far easier to redirect people to install page of extension for their respective browser? Such extension could then transform the button as needed to point to whichever social web instance.
We just need specific portals for sharing that remember your homeserver. See for example https://mastodonshare.com/.