Fix clipboard copy

This commit is contained in:
Corentin 2022-11-15 17:43:30 +09:00
commit 6a62b79a12
3 changed files with 4 additions and 2 deletions

2
.gitignore vendored
View file

@ -1,3 +1,5 @@
*.xpi *.xpi
*.zip
*.png
.web-extension-id .web-extension-id

View file

@ -20,5 +20,5 @@
"storage", "storage",
"clipboardWrite" "clipboardWrite"
], ],
"version": "1.0" "version": "1.1"
} }

View file

@ -223,7 +223,7 @@ class Entry
let otp_elt = document.createElement('div') let otp_elt = document.createElement('div')
otp_elt.className = 'otp' otp_elt.className = 'otp'
otp_elt.addEventListener('click', () => { otp_elt.addEventListener('click', () => {
navigator.clipboard.writeText(this.signature) navigator.clipboard.writeText(otp_elt.textContent)
}) })
new_elt.appendChild(otp_elt) new_elt.appendChild(otp_elt)