Web Share API JavaScript Example
Run
<!DOCTYPE html> <html> <head> <title>Minimal HTML Page</title> </head> <body> <button id="share">Click to Share</button> <script> document.getElementById('share').onclick = function() { if(navigator.share) { navigator.share({ url: 'https://lyty.dev', text: 'Read online tutorials and articles from lyty.dev', title: 'Lyty.dev online tutorials'}) .then(() => alert('Worked!')) .catch((err) => `Oops! Some error: ${err} occurred, does not work.`); } } </script> </body> </html>