The clipboard is the class’s shared locker: press Salin and writeText, write() with a ClipboardItem or the old execCommand really runs on your click, then…
A "Copy" button is everywhere: invite links, code, account numbers. Knowing its conditions (a secure context, activation from a click, read permission) makes your button work in every browser instead of failing silently.
The modern clipboard is async, and needs a secure page and a warm click
writeText fails silently on HTTP The Clipboard API only exists in a secure context (https or localhost); on http navigator.clipboard is undefined. Check first, catch its error with .catch(), and have a fallback.writeText without a user gesture Safari and Firefox refuse a clipboard write that does not come from a click or a key (Chrome is looser while the tab is focused). Never auto-copy on page load, and never await something slow before calling it: use a ClipboardItem holding a Promise.readText always works In Chrome read permission can be denied for good; Safari and Firefox show a small "Paste" button the user must click every time. Offer a plain paste box: the paste event needs no permission because the user pastes it themselves.clipboardData in that box proves what really arrived.write(item), copy, then paste One copy carries two types: text/html and text/plain.isActive when called turns false: the click’s activation window has run out.readText() The browser may ask for permission, or refuse. That is on purpose.