Respect newlines in clipboard text
This commit is contained in:
parent
7930e94f85
commit
924a8f1350
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue