Move apiClipboardGet implementation into Backend
This commit is contained in:
parent
2fef2bf5a8
commit
11b300ab76
@ -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();
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user