summaryrefslogtreecommitdiff
path: root/web/share/js/kvm/ocr.js
diff options
context:
space:
mode:
authorMaxim Devaev <[email protected]>2023-12-03 01:11:39 +0200
committerMaxim Devaev <[email protected]>2023-12-03 01:11:39 +0200
commit8c451918534259f9449b80ae09f56ac743da7551 (patch)
tree954f7beabb21024db85ef318f6b4b0486db143d4 /web/share/js/kvm/ocr.js
parentcfac039eb401f085c5fbe9f12d676563e6291d0a (diff)
pikvm/pikvm#1148: workaround for clipboard on firefox
Diffstat (limited to 'web/share/js/kvm/ocr.js')
-rw-r--r--web/share/js/kvm/ocr.js7
1 files changed, 1 insertions, 6 deletions
diff --git a/web/share/js/kvm/ocr.js b/web/share/js/kvm/ocr.js
index c08a0ed8..af0b97c7 100644
--- a/web/share/js/kvm/ocr.js
+++ b/web/share/js/kvm/ocr.js
@@ -170,15 +170,10 @@ export function Ocr(__getGeometry) {
let http = tools.makeRequest("GET", url, function() {
if (http.readyState === 4) {
if (http.status === 200) {
- navigator.clipboard.writeText(http.responseText).then(function() {
- wm.info("The text is copied to the clipboard");
- }, function(err) {
- wm.error("Can't copy text to the clipboard:<br>", err);
- });
+ wm.copyTextToClipboard(http.responseText);
} else {
wm.error("OCR error:<br>", http.responseText);
}
-
tools.el.setEnabled($("stream-ocr-button"), true);
tools.el.setEnabled($("stream-ocr-lang-selector"), true);
$("stream-ocr-led").className = "led-gray";