Add clipboard function

This commit is contained in:
Michał Gdula 2023-04-22 13:48:06 +00:00
parent e9e3706172
commit 76cc8456d2
4 changed files with 12 additions and 21 deletions

View file

@ -0,0 +1,8 @@
function copyToClipboard(data) {
try {
navigator.clipboard.writeText(data)
addNotification("Copied to clipboard!", 4);
} catch (err) {
addNotification("Oh noes, something when wrong D:", 2);
}
}