Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Navigator.share() doesn't work for second time

There is an example on MDN with Webshare API: https://mdn.github.io/dom-examples/web-share/

On my iOS device (iPhone 7 / iOS 14.0 / Safari) it works fine only once. For the second time it throws permission error:

Error: NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission.

Here are all the steps to reproduce:

  1. Go here
  2. Click "Share MDN!" button
  3. Choose one of suggested options or just close sharing popover
  4. Click on "Share MDN!" button again
  5. See the error

Do you have any suggestions how to fix that? Is it a known bug?

like image 325
Taif Alimov Avatar asked Sep 28 '20 11:09

Taif Alimov


1 Answers

I am also experiencing this. This looks like a regression bug in WebKit as seen here:

https://bugs.webkit.org/show_bug.cgi?id=216913

As for when Apple will include this and release it is up to them. I will update this answer when it works.

like image 136
TechnoTim Avatar answered Oct 07 '22 16:10

TechnoTim