My code is similar to many examples on the web, including MDN code at https://mdn.github.io/dom-examples/web-share/
btn.addEventListener('click', () => {
navigator.share(shareData)
.then(() =>
console.log('MDN shared successfully');
)
.catch((e) =>
console.error('Error: ' + e);
)
});
Issue:
navigator.share
returns a promise supposed to fail if sharing is denied. In my case it does so, but after several seconds of delay.
My main problem is this delay: I can fallback if I know sharing API is failing, except here I need to wait for an unknown amount of time before the error.
Mode details:
- The error is "Error: AbortError: Share canceled"
- I did not cancel anything (I see no UI before the error happens). Maybe Windows denied something without displaying any message.
- I am using Windows 8.1 Pro, this could be related.
- Same problem for me with Chrome 90.0.4430.93 (and previous version 89.0.4389.128), but also with Edge (89.0.774.54 Official build 64-bit)
- delay is longer than 20 seconds (disconnecting internet access does not change that)