Copy text, preferring the async Clipboard API and falling back to the
legacy execCommand path. The promise rejects on a denied permission or
an insecure (non-HTTPS) context, and an unhandled rejection there would
both lose the error and leave a button stuck, so it is always caught and
always resolved into a definite success or failure.
Copy
text, preferring the async Clipboard API and falling back to the legacyexecCommandpath. The promise rejects on a denied permission or an insecure (non-HTTPS) context, and an unhandled rejection there would both lose the error and leave a button stuck, so it is always caught and always resolved into a definite success or failure.