Is it possible to trigger share menu on smartphones (via HTML/JS)? Is it possible to trigger share menu on smartphones (via HTML/JS)? ios ios

Is it possible to trigger share menu on smartphones (via HTML/JS)?


It is possible with a big catch. Currently only available in Chrome for Android, Samsung internet and on Safari (desktop and mobile). And support is coming to Edge and Chrome on desktop http://caniuse.com/#feat=web-share

if (navigator.share) {  navigator.share({    title: document.title,    text: "Hello World",    url: window.location.href  })  .then(() => console.log('Successful share'))  .catch(error => console.log('Error sharing:', error));}

https://developers.google.com/web/updates/2016/10/navigator-share


I added this as all answers seems outdated by 2018-07-16.

It is possible, but only in a few browsers (MDN Reference), achieved througth the one method API in navigator:

navigator    .share({        title: document.title,        text: 'Hello World',        url: window.location.href    })    .then(() => console.log('Successful share! 🎉'))    .catch(err => console.error(err));

Google's reference: https://developers.google.com/web/updates/2016/10/navigator-share

Also, there was a thing called Web Intends which is a dead project, you should go with navigator.share instead.


Answered Apr 10 2013

To my knowledge, there is no such implementation in current browsers on mobile OS's. Since the question interested me - a google search revealed there is work being done in this direction:

Sorry - I do not know a workaround.