2 * @class Roo.util.Clipboard
10 copy : function(textToCopy) {
11 // navigator clipboard api needs a secure context (https)
12 if (navigator.clipboard && window.isSecureContext) {
13 // navigator clipboard api method'
14 navigator.clipboard.writeText(textToCopy);
18 var ta = document.createElement("textarea");
19 ta.value = textToCopy;
20 // make the textarea out of viewport
21 ta.style.position = "fixed";
22 ta.style.left = "-999999px";
23 ta.style.top = "-999999px";
24 document.body.appendChild(ta);
27 document.execCommand('copy');