logoalt Hacker News

input_shyesterday at 8:33 PM2 repliesview on HN

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).


Replies

rickstanleyyesterday at 8:42 PM

Why not both? A small button with "Copy link" text to, well, copy the current URL and another that calls "native" share, if available. I don't find it to be too many options, but I would guess that perhaps "Copy link" would have more clicks than `navigator.share`.

imoverclockedyesterday at 9:17 PM

You could switch between them depending on the browser. Desktop users are more likely to want an URL anyway, IMHO. FWIW: iOS has a "copy" option in the share popup.