logoalt Hacker News

ndegruchytoday at 8:17 PM3 repliesview on HN

I've added a button that just triggers `navigator.share()`[1]. I know most users do the copy-paste dance, but I find this is a good middle ground. Adding functionality for my users, but not adding special social media share buttons.

[1]: https://developer.mozilla.org/en-US/docs/Web/API/Navigator/s...


Replies

input_shtoday at 8:33 PM

I thought about using navigator.share myself, but decided to go with the basic "Copy URL" button instead, as navigator.share is pretty useless on desktops and not supported across browsers on phones either (Android's Webview being the big one for my use case).

show 2 replies
siriusfeynmantoday at 8:54 PM

Oh is this what that is, I saw a few sites use it recently but for whatever reason on my desktop pc (windows 10) the only options I have are copilot, another copilot (for some reason), one-note and discord, which claims to also be a copy to clipboard option but it doesn't work. So in the end for sites that don't show the raw string I have no way to copy something.

yieldcrvtoday at 9:06 PM

navigator.share is limited and the share intent breaks UX, adding more clicks to a funnel than I want

I leave it as an option for the users that really want it though, but surface other things like just the copy icon to put something directly on the clipboard

the articles best stats are from 2012, I’m sorry to inform that was 14 years ago, people are even more acclimated to direct linking