javascript - Navigator share not working in chrome desktop in mac os any alternative? - Stack Overflow

I have tried navigator.canshare also but it's working in chrome desktop. It is giving undefined.i

I have tried navigator.canshare also but it's working in chrome desktop. It is giving undefined.

if (navigator.share) {
    navigator.share({
        title: 'Lot Quality Report',
        text: 'Lot Link -',
        url: ''
    })
        .then(() => console.log('Successful share')) //this is for sucess
            .catch((error) => console.log('Error sharing', error));
  } else {
    console.log('Share not supported on this browser, do it the old way.');
    alert('Share not supported on this browser, do it the old way.');
}

This code is not working on google chrome desktop in mac os. Any alternative I can use to run share functionality on google chrome desktop.

I have tried navigator.canshare also but it's working in chrome desktop. It is giving undefined.

if (navigator.share) {
    navigator.share({
        title: 'Lot Quality Report',
        text: 'Lot Link -',
        url: 'https://www.google.'
    })
        .then(() => console.log('Successful share')) //this is for sucess
            .catch((error) => console.log('Error sharing', error));
  } else {
    console.log('Share not supported on this browser, do it the old way.');
    alert('Share not supported on this browser, do it the old way.');
}

This code is not working on google chrome desktop in mac os. Any alternative I can use to run share functionality on google chrome desktop.

Share Improve this question edited Nov 1, 2022 at 6:57 naman verma asked Oct 31, 2022 at 5:06 naman vermanaman verma 1351 silver badge14 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 10

I have found the answer, in mac os we need to change the settings of browser . Url - https://winaero./chrome-to-get-web-share-api-support-on-desktop/

Click on - chrome://flags/#web-share >> enable >> relaunch browser

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1743879566a4522926.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信