mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-02 19:59:08 +08:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
d26b46478a
@ -50,9 +50,8 @@ export const readClipboard = async () => {
|
||||
} else if (isInHarmony()) {
|
||||
text.textPlain = window.JSHarmony.readClipboard();
|
||||
}
|
||||
if (typeof navigator.clipboard === "undefined" || !navigator.clipboard.read) {
|
||||
return text;
|
||||
}
|
||||
|
||||
try {
|
||||
const clipboardContents = await navigator.clipboard.read();
|
||||
for (const item of clipboardContents) {
|
||||
if (item.types.includes("text/html")) {
|
||||
@ -68,6 +67,8 @@ export const readClipboard = async () => {
|
||||
text.files = [new File([blob], "image.png", {type: "image/png", lastModified: Date.now()})];
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
}
|
||||
return text;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user