Skip to content

Implement chrome.downloads API for extension compatibility #259

@powellnorma

Description

@powellnorma

Extensions like SingleFile depend on chrome.downloads to save pages, but it's currently not implemented.

Core requirements:

  • downloads.download(options) — Support both regular URLs (via net.fetch) and blob: URLs (need to fetch from the extension's webContents context since blobs aren't accessible cross-process). If saveAs is true, show a save dialog; otherwise write directly to ~/Downloads with conflict resolution. Return an auto-incrementing download ID.
  • downloads.search(query) — Filter tracked downloads by id/filename/state.
  • downloads.cancel(id) — Cancel in-progress downloads.
  • Fire downloads.onChanged events on state transitions (in_progress → complete/interrupted) so extensions can react.

The tricky part is blob: URL handling — the blob lives in the renderer process, so you need to round-trip through the sender's webContents (e.g. executeJavaScript to fetch the blob and serialize it as a byte array) before writing to disk on the main process side.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request
No fields configured for Feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions