Skip to content

Commit 83d5d6b

Browse files
committed
fix copy link in browser, closes #4682
1 parent 90f4c6b commit 83d5d6b

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/public/app/services/utils.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -487,12 +487,14 @@ function areObjectsEqual () {
487487
}
488488

489489
function copyHtmlToClipboard(content) {
490-
const clipboardItem = new ClipboardItem({
491-
'text/html': new Blob([content], {type: 'text/html'}),
492-
'text/plain': new Blob([content], {type: 'text/plain'})
493-
});
494-
495-
navigator.clipboard.write([clipboardItem]);
490+
function listener(e) {
491+
e.clipboardData.setData("text/html", content);
492+
e.clipboardData.setData("text/plain", content);
493+
e.preventDefault();
494+
}
495+
document.addEventListener("copy", listener);
496+
document.execCommand("copy");
497+
document.removeEventListener("copy", listener);
496498
}
497499

498500
/**

0 commit comments

Comments
 (0)