Не работает копирование в буфер обмена

Есть функция:

const copyToClipboard = function (text) {
if (!navigator.clipboard) {
  const $temp = $("<input>");
  $("body").append($temp);
  $temp.val(text).select();
  document.execCommand("copy");
  $temp.remove();
} else {
  navigator.clipboard
    .writeText(text)
    .then(() => {})
    .catch((err) => {
      console.error("Error in copying text: ", err);
    });
}

};

В файрфокс (последняя версия) перестали работать оба варианта. Не могу найти решение. Помогите


Ответы (0 шт):