Respect newlines in clipboard text

This commit is contained in:
unknown 2018-12-02 18:04:58 -06:00 committed by Kamil Tomala
parent 7930e94f85
commit 924a8f1350
1 changed files with 2 additions and 2 deletions

View File

@ -61,10 +61,10 @@ function uninject(id) {
function checkClipboard() { function checkClipboard() {
const pasteTarget = document.querySelector("#paste-target") const pasteTarget = document.querySelector("#paste-target")
pasteTarget.textContent = "" pasteTarget.innerText = ""
pasteTarget.focus() pasteTarget.focus()
document.execCommand("paste") document.execCommand("paste")
const content = pasteTarget.textContent const content = pasteTarget.innerText
if(content.trim() !== previousContent.trim() && content != "") { if(content.trim() !== previousContent.trim() && content != "") {
listeningTabs.forEach(id => notifyForeground(id, content)) listeningTabs.forEach(id => notifyForeground(id, content))
previousContent = content previousContent = content