Skip to content

Commit 5bf30b1

Browse files
committed
refactor: shell:copyToClipboard will use browser clicpboard api when available
1 parent 6d67e6b commit 5bf30b1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/phoenix/shell.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ Phoenix.app = {
7474
copyToClipboard: function (textToCopy) {
7575
if(Phoenix.browser.isTauri){
7676
return window.__TAURI__.clipboard.writeText(textToCopy);
77+
} else if(window.navigator && window.navigator.clipboard){
78+
return window.navigator.clipboard.writeText(textToCopy);
7779
}
7880
const textArea = document.createElement("textarea");
7981
textArea.value = textToCopy;

0 commit comments

Comments
 (0)