From b8765bdd99ef40f9ddd13a2a12a68c27d859cef6 Mon Sep 17 00:00:00 2001 From: wanglin2 <1013335014@qq.com> Date: Thu, 22 Aug 2024 22:32:28 +0800 Subject: [PATCH] =?UTF-8?q?Feat:=E5=87=8F=E5=B0=91=E4=B8=80=E6=AC=A1?= =?UTF-8?q?=E5=9C=A8firefox=E6=B5=8F=E8=A7=88=E5=99=A8=E4=B8=8A=E7=B2=98?= =?UTF-8?q?=E8=B4=B4=E5=89=AA=E8=B4=B4=E6=9D=BF=E5=86=85=E5=AE=B9=E6=97=B6?= =?UTF-8?q?=E7=9A=84=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- simple-mind-map/src/utils/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/simple-mind-map/src/utils/index.js b/simple-mind-map/src/utils/index.js index 67b913dd..5f0cbf8c 100644 --- a/simple-mind-map/src/utils/index.js +++ b/simple-mind-map/src/utils/index.js @@ -1080,14 +1080,15 @@ export const getDataFromClipboard = async () => { let text = null let img = null if (navigator.clipboard) { - text = await navigator.clipboard.readText() const items = await navigator.clipboard.read() if (items && items.length > 0) { for (const clipboardItem of items) { for (const type of clipboardItem.types) { if (/^image\//.test(type)) { img = await clipboardItem.getType(type) - break + } else if (type === 'text/plain') { + const blob = await clipboardItem.getType(type) + text = await blob.text() } } }