Skip to content

Commit

Permalink
Fix Clipboard copy/paste on Firefox - use ES5 (#8332)
Browse files Browse the repository at this point in the history
Follow up of #8320, that causes issues in 4.2.x. Added the change to main branch to avoid issues in future backports of changes in this file.
  • Loading branch information
josegar74 committed Sep 2, 2024
1 parent 1e643bd commit 1094237
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1143,7 +1143,7 @@
return {
copy: function (toCopy) {
var deferred = $q.defer();
if (navigator.clipboard?.writeText) {
if (navigator.clipboard && navigator.clipboard.writeText) {
navigator.clipboard.writeText(toCopy).then(
function () {
deferred.resolve();
Expand All @@ -1160,7 +1160,7 @@
},
paste: function () {
var deferred = $q.defer();
if (navigator.clipboard?.readText) {
if (navigator.clipboard && navigator.clipboard.readText) {
navigator.clipboard.readText().then(
function (text) {
deferred.resolve(text);
Expand Down

0 comments on commit 1094237

Please sign in to comment.