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) {
|
||||
const clipboardItem = new ClipboardItem({
|
||||
'text/html': new Blob([content], {type: 'text/html'}),
|
||||
'text/plain': new Blob([content], {type: 'text/plain'})
|
||||
});
|
||||
|
||||
navigator.clipboard.write([clipboardItem]);
|
||||
function listener(e) {
|
||||
e.clipboardData.setData("text/html", content);
|
||||
e.clipboardData.setData("text/plain", content);
|
||||
e.preventDefault();
|
||||
}
|
||||
document.addEventListener("copy", listener);
|
||||
document.execCommand("copy");
|
||||
document.removeEventListener("copy", listener);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user