Make apiClipboardGet use plaintext
Also clear the value before returning
This commit is contained in:
parent
bf93d9f5f9
commit
11b94d5a82
@ -12,7 +12,7 @@
|
|||||||
<link rel="icon" type="image/png" href="/mixed/img/icon128.png" sizes="128x128">
|
<link rel="icon" type="image/png" href="/mixed/img/icon128.png" sizes="128x128">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="clipboard-paste-target" contenteditable="true"></div>
|
<textarea id="clipboard-paste-target" contenteditable="true"></textarea>
|
||||||
|
|
||||||
<script src="/mixed/lib/handlebars.min.js"></script>
|
<script src="/mixed/lib/handlebars.min.js"></script>
|
||||||
<script src="/mixed/lib/jszip.min.js"></script>
|
<script src="/mixed/lib/jszip.min.js"></script>
|
||||||
|
@ -479,10 +479,12 @@ class Backend {
|
|||||||
|
|
||||||
async _onApiClipboardGet() {
|
async _onApiClipboardGet() {
|
||||||
const clipboardPasteTarget = this.clipboardPasteTarget;
|
const clipboardPasteTarget = this.clipboardPasteTarget;
|
||||||
clipboardPasteTarget.innerText = '';
|
clipboardPasteTarget.value = '';
|
||||||
clipboardPasteTarget.focus();
|
clipboardPasteTarget.focus();
|
||||||
document.execCommand('paste');
|
document.execCommand('paste');
|
||||||
return clipboardPasteTarget.innerText;
|
const result = clipboardPasteTarget.value;
|
||||||
|
clipboardPasteTarget.value = '';
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Command handlers
|
// Command handlers
|
||||||
|
Loading…
Reference in New Issue
Block a user