diff --git a/script.js b/script.js index 9195b41..3d6cd56 100644 --- a/script.js +++ b/script.js @@ -548,25 +548,19 @@ class MinecraftChatParser { } const mapInfo = this.currentChatInfo.mapDownload; - const mapUrl = `./maps/${mapInfo.filename}`; + // Nutze mapInfo.url, falls vorhanden, sonst lokalen Pfad + const mapUrl = mapInfo.url ? mapInfo.url : `./maps/${mapInfo.filename}`; + const downloadName = mapInfo.url ? mapInfo.url.split('/').pop() : mapInfo.filename; // Create temporary download link const downloadLink = document.createElement('a'); downloadLink.href = mapUrl; - downloadLink.download = mapInfo.filename; + downloadLink.download = downloadName; downloadLink.style.display = 'none'; document.body.appendChild(downloadLink); downloadLink.click(); document.body.removeChild(downloadLink); - - // Show feedback - const originalText = this.downloadMap.innerHTML; - this.downloadMap.innerHTML = '⬇️ Downloading...'; - - setTimeout(() => { - this.downloadMap.innerHTML = originalText; - }, 2000); } }