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:
@@ -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);
|
||||
// Use fallback method directly (more reliable)
|
||||
fallbackCopy(text);
|
||||
});
|
||||
} else {
|
||||
// Fallback for older browsers
|
||||
fallbackCopy(text);
|
||||
}
|
||||
}
|
||||
|
||||
function fallbackCopy(text) {
|
||||
|
||||
Reference in New Issue
Block a user