From 11b94d5a82f520706b344fd70ffa9e502d18086c Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Thu, 12 Dec 2019 21:01:49 -0500 Subject: Make apiClipboardGet use plaintext Also clear the value before returning --- ext/bg/js/backend.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'ext/bg/js') diff --git a/ext/bg/js/backend.js b/ext/bg/js/backend.js index 7b6498e1..ca03f94d 100644 --- a/ext/bg/js/backend.js +++ b/ext/bg/js/backend.js @@ -479,10 +479,12 @@ class Backend { async _onApiClipboardGet() { const clipboardPasteTarget = this.clipboardPasteTarget; - clipboardPasteTarget.innerText = ''; + clipboardPasteTarget.value = ''; clipboardPasteTarget.focus(); document.execCommand('paste'); - return clipboardPasteTarget.innerText; + const result = clipboardPasteTarget.value; + clipboardPasteTarget.value = ''; + return result; } // Command handlers -- cgit v1.2.3