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.
Extensions like SingleFile depend on
chrome.downloadsto save pages, but it's currently not implemented.Core requirements:
downloads.download(options)— Support both regular URLs (vianet.fetch) andblob:URLs (need to fetch from the extension's webContents context since blobs aren't accessible cross-process). IfsaveAsis true, show a save dialog; otherwise write directly to~/Downloadswith 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.downloads.onChangedevents 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.executeJavaScriptto fetch the blob and serialize it as a byte array) before writing to disk on the main process side.