Save to clipboard
Push text into the clipboard. Use the following function
async function copyToClipboard(text) {
try {
await navigator.clipboard.writeText(text);
} catch (error) {
console.error(error.message);
}
}
copyToClipboard("Text injected to clipboard");
The embedded script will request permission to write to your clipboard like so

You will need to allow to see the surprise message I have written to your clipboard.
If you don't allow it check the console.log, messages could be denied like so
