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.
- Using the HTML-Component
- Using the Custom-Element
- 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?
Not long ago, i was helping here…
I generated a code → which was capable to → SCAN ← the iFrame directly on the wix base-page.
The code did not find → Allow=web-share <----
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).
The iFrame do not have this property or it is resctricted like it seems, due to security-reasons i think.
Maybe you can run my generated code on your site by your own and check the resultsm which will look like…