mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +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()) {
|
} else if (isInHarmony()) {
|
||||||
return window.JSHarmony.readClipboard();
|
return window.JSHarmony.readClipboard();
|
||||||
}
|
}
|
||||||
|
if (typeof navigator.clipboard === "undefined") {
|
||||||
|
alert(window.siyuan.languages.clipboardPermissionDenied);
|
||||||
|
return "";
|
||||||
|
}
|
||||||
return navigator.clipboard.readText().catch(() => {
|
return navigator.clipboard.readText().catch(() => {
|
||||||
alert(window.siyuan.languages.clipboardPermissionDenied);
|
alert(window.siyuan.languages.clipboardPermissionDenied);
|
||||||
}) || "";
|
}) || "";
|
||||||
|
|
@ -142,6 +146,10 @@ export const readClipboard = async () => {
|
||||||
text.siyuanHTML = textObj.textSiyuan;
|
text.siyuanHTML = textObj.textSiyuan;
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
|
if (typeof navigator.clipboard === "undefined") {
|
||||||
|
alert(window.siyuan.languages.clipboardPermissionDenied);
|
||||||
|
return text;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
const clipboardContents = await navigator.clipboard.read().catch(() => {
|
const clipboardContents = await navigator.clipboard.read().catch(() => {
|
||||||
alert(window.siyuan.languages.clipboardPermissionDenied);
|
alert(window.siyuan.languages.clipboardPermissionDenied);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue