diff --git a/extensions/codeGIO/ExtraUtilities.js b/extensions/codeGIO/ExtraUtilities.js index ff188064fe..3c7414dde4 100644 --- a/extensions/codeGIO/ExtraUtilities.js +++ b/extensions/codeGIO/ExtraUtilities.js @@ -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 ''; }