How to use the clipboard.set function in clipboard

To help you get started, we’ve selected a few clipboard examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github palant / pfp / lib / ui / allPasswordsBindings.js View on Github external
promise.then(password =>
  {
    require("clipboard").set(password);
    port.emit("passwordCopied", id);
  }).catch(reason => port.emit("passwordError", String(reason)));
}
github mozilla / browsermirror / lib / sharer.js View on Github external
shareUrl.addEventListener('click', (function (event) {
      event.preventDefault();
      event.stopPropagation();
      shareUrl.style.display = 'none';
      shareField.style.display = '';
      shareText.style.display = '';
      shareField.focus();
      shareField.select();
      clipboard.set(this.urls.share, 'text');
    }).bind(this), false);
    shareField.addEventListener('blur', function () {
github BoringCode / TranslateThis / main.js View on Github external
onComplete: function (response) {
        translated = response.json.responseData.translatedText;
        if (replaceorcopy === "replace") {
          selection.text = translated;
		} else {
          clipboard.set(translated); 
		}
      }
    });