Skip to content

fix(attachments): use downloads API instead of a.click() in popup#55

Merged
bartekmp merged 1 commit into
mainfrom
fix/attachment-downloads
Jun 4, 2026
Merged

fix(attachments): use downloads API instead of a.click() in popup#55
bartekmp merged 1 commit into
mainfrom
fix/attachment-downloads

Conversation

@bartekmp

@bartekmp bartekmp commented Jun 4, 2026

Copy link
Copy Markdown
Owner

Summary

  • Replaces the a.click() blob-URL trick with api.downloads.download(), the correct Firefox extension API for initiating file downloads from a popup context
  • Adds the "downloads" manifest permission required by the API
  • Surfaces download errors visually (red border on the attachment button) and logs them with console.error — failures are no longer silent

The programmatic anchor-click approach caused Firefox to close the popup
(focus loss during download initiation), making attachment downloads look
like they did nothing. Replace with api.downloads.download() which is the
correct extension API for initiating downloads from a popup context.

Also surfaces download errors visually (red border on the button) and logs
them to the console, so failures are no longer completely silent.

Adds the "downloads" manifest permission required by the API.

https://claude.ai/code/session_011k8zuM3FhFRooN1fpGYhNi
@bartekmp bartekmp merged commit 668c3a7 into main Jun 4, 2026
1 check passed
@bartekmp bartekmp deleted the fix/attachment-downloads branch June 4, 2026 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants