Now, broswer can share items as APP, using Web Share API

API is pretty simple, use navigator.share to detect browser ability, use the same way as Promise.

if (navigator.share) {
  navigator
    .share({
      title: "Share my blog",
      text: "Web development tutorial blogs",
      url: "https://justforuse.github.io/blog/en-us/"
    })
    <!-- select item callback -->
    .then(() => console.log("thanks for share"))
    <!-- cancel share callback -->
    .catch(error => console.log("error", error));
}

Online demo, access with Chrome with mobile:

See the Pen by (@justforuse) on CodePen.

But its compatibility is bad now, just about 45% around the world.

Can I Use web-share? Data on support for the web-share feature across the major browsers from caniuse.com.


πŸ‘‡ Please leave your comment if you like this.πŸ‘‡