fix: attach anchor to document before click for Firefox download compatibility

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
chihlasm
2026-03-13 02:39:57 -04:00
parent 8cadc5b1b3
commit 361ffabe57

View File

@@ -44,7 +44,9 @@ export function ScriptGeneratorPanel() {
const a = document.createElement('a')
a.href = url
a.download = `${selectedTemplate.slug}.ps1`
document.body.appendChild(a)
a.click()
document.body.removeChild(a)
URL.revokeObjectURL(url)
}