Navigator.share (Permission denied)

I added an Iframe to my website, in order to use “navigator.share”, and the following code is triggered when the user clicks a button contained in the Iframe:

if (navigator.share) {
title: ‘Web Share Test’,
text: ‘Take a look at this!’,
url: ‘’,

The code works, as you can see here:

But when I open the actual page on my website where I want the share button to be, I keep getting an error (Permission Denied).

I tried using ''Allow=web-share", but no luck. Can anyone help me?

Not all browsers and OS’s support this feature. Even on my own computer (Chrome and MacOS) it fails.

See "navigator.share" | Can I use... Support tables for HTML5, CSS3, etc for more info