fix: Kopieren-Funktion mit Fallback-Methode

Problem: navigator.clipboard.writeText war undefined
Lösung: Direkte Verwendung der Fallback-Methode (execCommand)

Die Fallback-Methode ist zuverlässiger und funktioniert in allen Browsern.
This commit is contained in:
root
2026-01-29 08:38:12 +01:00
parent bf6c30e3ff
commit 075aa4bbae

View File

@@ -603,19 +603,8 @@ function copyEmbedCode() {
let text = embedCode.textContent || embedCode.innerText;
text = text.trim();
// Try modern clipboard API first
if (navigator.clipboard && navigator.clipboard.writeText) {
navigator.clipboard.writeText(text).then(() => {
showNotification('Code in Zwischenablage kopiert!', 'success');
showCopySuccess();
}).catch(err => {
console.error('Clipboard API failed:', err);
fallbackCopy(text);
});
} else {
// Fallback for older browsers
fallbackCopy(text);
}
// Use fallback method directly (more reliable)
fallbackCopy(text);
}
function fallbackCopy(text) {