Use web share API in Velo

Hi, I think this should be fairly simple: all I want to do is create a button on a page which calls web share APIs navigator.share() method. However, when I try this I get the following error: Property ‘share’ does not exist on type ‘WorkerNavigator’ - presumably meaning that the native functionality has been hidden or masked by Wix. Is it possible to do this? Either through Velo or some external code or something. Thanks!

Yes you have several options of how to do that.

  1. Using the HTML-Component
  2. Using the Custom-Element
  3. Implementing your code directly on the wix-page (DASHBOARD-SETTINGS)

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) {
navigator.share({
title: ‘Web Share Test’,
text: ‘Take a look at this!’,
url: ‘www.google.com’,
})

The code works, as you can see here:
https://innovemsociais-wixstudio-io.filesusr.com/html/fb7c74_b668cae72f9b4bae5979d1e548d30224.html

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?