You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm receiving the following error message on firefox 60.3.0esr version: document.execCommand('cut'/'copy') was denied because it was not called from inside a short running user-generated event handler.
This is a sample of what I'm trying to do
import clipboard from 'clipboard-polyfill'
const response = await axios.get('/api/path')
clipboard.writeText(response)
I'm using clipboard-pollyfill 2.7.0 version
This code works as intended on google chrome 70.0.3538.77 version
The text was updated successfully, but these errors were encountered:
As the error message says, Firefox requires the clipboard API to be called inside a short-running event handler. await axios.get('/api/path') can be a relatively long round-trip. Chrome has a bit of a leniency period, but it will also fail on slow connections to your server.
The best option is either to prepare the data ahead of time, or show a messages to the user that you are preparing the data and asking them to trigger another action to actually copy the data.
See w3c/clipboard-apis#41 for proposals to handle delayed clipboard data in the future.
Hi,
I'm receiving the following error message on firefox 60.3.0esr version:
document.execCommand('cut'/'copy') was denied because it was not called from inside a short running user-generated event handler.
This is a sample of what I'm trying to do
I'm using clipboard-pollyfill 2.7.0 version
This code works as intended on google chrome 70.0.3538.77 version
The text was updated successfully, but these errors were encountered: