summaryrefslogtreecommitdiff
path: root/ext/bg/js/backend.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-12-09 21:59:18 -0500
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-12-13 23:11:56 -0500
commit11b300ab7670011c2a06e75f72eea4e9bf87cd97 (patch)
tree2ac61bf35dbf8fc40eb95eb97d0b06cbcf6a1f4f /ext/bg/js/backend.js
parent2fef2bf5a87d142310ca79a75894098984ab1ffa (diff)
Move apiClipboardGet implementation into Backend
Diffstat (limited to 'ext/bg/js/backend.js')
-rw-r--r--ext/bg/js/backend.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/ext/bg/js/backend.js b/ext/bg/js/backend.js
index 62c077a2..877161c7 100644
--- a/ext/bg/js/backend.js
+++ b/ext/bg/js/backend.js
@@ -475,8 +475,12 @@ class Backend {
};
}
- _onApiClipboardGet() {
- return apiClipboardGet();
+ async _onApiClipboardGet() {
+ const clipboardPasteTarget = this.clipboardPasteTarget;
+ clipboardPasteTarget.innerText = '';
+ clipboardPasteTarget.focus();
+ document.execCommand('paste');
+ return clipboardPasteTarget.innerText;
}
// Command handlers