diff --git a/templates/Froxlor/assets/js/jquery/global.js b/templates/Froxlor/assets/js/jquery/global.js index 067c4dffc6..5127dace48 100644 --- a/templates/Froxlor/assets/js/jquery/global.js +++ b/templates/Froxlor/assets/js/jquery/global.js @@ -12,9 +12,14 @@ export default function () { new bootstrap.Popover($(this)); }) + if (!window.isSecureContext) { + // hide all copyClipboard buttons as this only works in a secure context + $('.copyClipboard').hide(); + } + $('.copyClipboard').on('click', function (e) { e.preventDefault(); - const source_element = $(this).data('clipboard-source').text(); + const source_element = $(this).data('clipboard-source'); navigator.clipboard.writeText($('#' + source_element).text().trim()); })