DEV Community

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

Posted on

4 2

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.

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay