Skip to content

Commit

Permalink
Update ExtraUtilities.js
Browse files Browse the repository at this point in the history
  • Loading branch information
LilyMakesThings authored Jun 24, 2023
1 parent f76fab4 commit 14e8cee
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions extensions/codeGIO/ExtraUtilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,12 +326,19 @@
}

set_clipboard(args) {
navigator.clipboard.writeText(args.one);
if (navigator.clipboard && navigator.clipboard.writeText) {
navigator.clipboard.writeText(args.one);
}
}

get_clipboard() {
if (navigator.clipboard && navigator.clipboard.readText) {
return navigator.clipboard.readText();
return Scratch.canReadClipboard().then(allowed => {
if (allowed) {
return navigator.clipboard.readText();
}
return '';
});
}
return '';
}
Expand Down

0 comments on commit 14e8cee

Please sign in to comment.