summaryrefslogtreecommitdiff
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
parent2fef2bf5a87d142310ca79a75894098984ab1ffa (diff)
Move apiClipboardGet implementation into Backend
-rw-r--r--ext/bg/js/api.js8
-rw-r--r--ext/bg/js/backend.js8
2 files changed, 8 insertions, 8 deletions
diff --git a/ext/bg/js/api.js b/ext/bg/js/api.js
index 49a6c14f..095734fb 100644
--- a/ext/bg/js/api.js
+++ b/ext/bg/js/api.js
@@ -93,10 +93,6 @@ function apiGetEnvironmentInfo() {
return utilBackend()._onApiGetEnvironmentInfo();
}
-async function apiClipboardGet() {
- const clipboardPasteTarget = utilBackend().clipboardPasteTarget;
- clipboardPasteTarget.innerText = '';
- clipboardPasteTarget.focus();
- document.execCommand('paste');
- return clipboardPasteTarget.innerText;
+function apiClipboardGet() {
+ return utilBackend()._onApiClipboardGet();
}
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