Use native navigator clipboard over element data clipboard function

This commit is contained in:
Sebastiaan Pasma 2018-07-16 17:42:15 +02:00
commit 1871992303
No known key found for this signature in database
GPG key ID: 9A2B0C8B95A1D26F

View file

@ -11,10 +11,15 @@ angular.module('copayApp.services').factory('clipboardService', function ($http,
cordova.plugins.clipboard.copy(data);
} else if (platformInfo.isNW) {
nodeWebkitService.writeToClipboard(data);
} else if (navigator && navigator.clipboard) {
$log.debug("Use navigator clipboard.")
navigator.clipboard.writeText(data).catch(err => {
$log.debug("Clipboard writing is not supported in your browser..");
});
} else if (clipboard.supported) {
clipboard.copyText(data);
} else {
// No supported
// Not supported
return;
}