Clipboard API throws NotAllowedError on our staging site
navigator.clipboard.writeText works on localhost and in prod (https), but on staging, which is http://staging.internal:8080, it throws: NotAllowedError: Write permission denied. I know clipboard is a secure-context API and http is the problem. I cannot easily get a cert for staging. Is there a fallback that is not document.execCommand('copy')? We tried that and it is flaky in Safari. Would rather not add a second code path if I can avoid it.
4 replies