mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 14:40:12 +01:00
This commit is contained in:
parent
9c79566adc
commit
635f8b3bf5
1 changed files with 8 additions and 0 deletions
|
|
@ -98,6 +98,10 @@ export const readText = () => {
|
|||
} else if (isInHarmony()) {
|
||||
return window.JSHarmony.readClipboard();
|
||||
}
|
||||
if (typeof navigator.clipboard === "undefined") {
|
||||
alert(window.siyuan.languages.clipboardPermissionDenied);
|
||||
return "";
|
||||
}
|
||||
return navigator.clipboard.readText().catch(() => {
|
||||
alert(window.siyuan.languages.clipboardPermissionDenied);
|
||||
}) || "";
|
||||
|
|
@ -142,6 +146,10 @@ export const readClipboard = async () => {
|
|||
text.siyuanHTML = textObj.textSiyuan;
|
||||
return text;
|
||||
}
|
||||
if (typeof navigator.clipboard === "undefined") {
|
||||
alert(window.siyuan.languages.clipboardPermissionDenied);
|
||||
return text;
|
||||
}
|
||||
try {
|
||||
const clipboardContents = await navigator.clipboard.read().catch(() => {
|
||||
alert(window.siyuan.languages.clipboardPermissionDenied);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue