From 11b300ab7670011c2a06e75f72eea4e9bf87cd97 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Mon, 9 Dec 2019 21:59:18 -0500 Subject: Move apiClipboardGet implementation into Backend --- ext/bg/js/api.js | 8 ++------ ext/bg/js/backend.js | 8 ++++++-- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'ext') 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 -- cgit v1.2.3