WriteTextToClipboard Not Working On Safari

Wappler Version : 4.3.2
Operating System : MacOS BigSur
Server Model: NodeJS

Expected behavior

Write text to clipboard should copy text to clipboard, like it does in browsers on Windows.

Actual behavior

Works fine in Chrome on MacOS. Safari on MacOS is returning this error.

Is the website running with https? Safari seems to only allow usage of the clipboard api on secure pages.

Yes, its HTTPS.

And was there a user interaction? That is an other requirement from Safari. The api must be triggered by a used with an event like a click or touch.

On click of a button, I call a SC which returns the URL. On dynamic success event, I use this function to copy to that URL in clipboard.
So no direct user interaction I suppose.

@patrick Any update on this?

I’m afraid that the writeText on Safari is limited to user interactions, so you can not do it on the load event. You should first load the server action and then let the user click on a button to copy the result to clipboard. That is how Safari implemented the clipboard api.

Damn.

Is there any way to identify if the app is running on Safari? Maybe from Browser component?

You could identify it using the userAgent or by feature detection, but it is never very accurate.

I finally did a separate UI/UX for Safari, by identifying the browser by user agent.
Its not the best option, but the task is not very critical so can live with this work-around for now.