mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
fix copy link in browser, closes #4682
This commit is contained in:
parent
90f4c6b0d1
commit
83d5d6bbd8
@ -487,12 +487,14 @@ function areObjectsEqual () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function copyHtmlToClipboard(content) {
|
function copyHtmlToClipboard(content) {
|
||||||
const clipboardItem = new ClipboardItem({
|
function listener(e) {
|
||||||
'text/html': new Blob([content], {type: 'text/html'}),
|
e.clipboardData.setData("text/html", content);
|
||||||
'text/plain': new Blob([content], {type: 'text/plain'})
|
e.clipboardData.setData("text/plain", content);
|
||||||
});
|
e.preventDefault();
|
||||||
|
}
|
||||||
navigator.clipboard.write([clipboardItem]);
|
document.addEventListener("copy", listener);
|
||||||
|
document.execCommand("copy");
|
||||||
|
document.removeEventListener("copy", listener);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user