Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

navigator.share() is not a function

Tags:

reactjs

I'm trying to use navigator.canShare() and navigator.share() to experiment with websharing in a react app.

When I call navigator.canShare() in react, I get the following run time error:

TypeError: navigator.share is not a function

How can I get react to recognize navigator.canShare()?

like image 249
afshin Avatar asked Dec 13 '25 15:12

afshin


1 Answers

As mentioned in MDN docs, you can only use navigator.share() over HTTPS

Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

like image 115
Ardalan Avatar answered Dec 15 '25 09:12

Ardalan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!