DEV Community

Cover image for The Web Share API In Chrome 89
Mafee7
Mafee7

Posted on

The Web Share API In Chrome 89

The Web Share API In Chrome 89

Intro: 4/3/21 - Chrome Web Devs Announced The Chrome Version 89! (Stable)

They Added Some Features, A New Navigator API Has Been Added - navigator.share().

Refer To: developer.chrome.com

Video:

As Per The Video, The API Was Supported On Chrome Mobile Version.

To update Chrome: Click On 3 Dots
imageThen Hover Over HelpimageThen Click On About ChromeimageThen Click on Update Chrome, It Will Take Some Time To update And then Click On Relaunch Chrome

Your Chrome Should Be Updated To Version 89 Or This Code Will Not Work, Try To Run The Code By Clicking A Button Or It May Give A Must be handling a user gesture to perform a share request Error

Try It Out:

if("share" in navigator){
navigator.share({

   title: "Coding Articles - Dev.to",
   text: "Dev.to",
   url: 'https://dev.to'

});
}
Enter fullscreen mode Exit fullscreen mode
Note: You Can Also Use .then, .catch as it is a Promise.

Top comments (0)