From 1094237d90dde96f233e4199af89907ba442fc1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jose=20Garc=C3=ADa?= Date: Mon, 2 Sep 2024 13:56:40 +0200 Subject: [PATCH] Fix Clipboard copy/paste on Firefox - use ES5 (#8332) 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. --- .../resources/catalog/components/utility/UtilityDirective.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web-ui/src/main/resources/catalog/components/utility/UtilityDirective.js b/web-ui/src/main/resources/catalog/components/utility/UtilityDirective.js index 425ce230238..493c85a99f6 100644 --- a/web-ui/src/main/resources/catalog/components/utility/UtilityDirective.js +++ b/web-ui/src/main/resources/catalog/components/utility/UtilityDirective.js @@ -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(); @@ -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);