Skip to content

fix: downloads from iframes/subframes now work (Gmail, embedded viewers) (#9)#34

Merged
arzafran merged 1 commit into
mainfrom
fix/issue-9-iframe-downloads
Jun 26, 2026
Merged

fix: downloads from iframes/subframes now work (Gmail, embedded viewers) (#9)#34
arzafran merged 1 commit into
mainfrom
fix/issue-9-iframe-downloads

Conversation

@arzafran

Copy link
Copy Markdown
Member

What this does

Clicking a download link inside an iframe (a Gmail attachment, an embedded PDF viewer's Download button, etc.) silently did nothing — the file never downloaded. The browser's response handler returned early for any subframe response before checking for a Content-Disposition: attachment header, so WebKit treated the download as inline navigation and dropped it. Downloads initiated from inside iframes now work.

Summary

In both BrowserNavigationDelegate (BrowserPanel.swift) and PopupNavigationDelegate (BrowserPopupWindowController.swift), the decidePolicyFor navigationResponse early-return for !isForMainFrame now first checks for Content-Disposition: attachment and returns .download when present, so the response reaches the existing BrowserDownloadDelegate. Non-attachment subframe responses still pass through as .allow.

Test Plan

  • CI build passes
  • Manual: open Gmail in a browser pane, download an attachment from inside the message iframe

Fixes #9

@arzafran arzafran merged commit 041e511 into main Jun 26, 2026
6 of 8 checks passed
@arzafran arzafran deleted the fix/issue-9-iframe-downloads branch June 26, 2026 15:03
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.

Browser pane: downloads fail from iframes/subframes (Gmail, embedded viewers, PDF Download button)

1 participant