Comfy-Org / Comfy-Org/ComfyUI_frontend

feat: implement XHR + objectURL approach for browser download progress in createBrowserDownloadService

Open
#11,872 0 comments 0 reactions 1 assignee Claimed by @christian-byrne View on GitHub
enhancement
Dominant language
TypeScript
Stars
2k
Forks
699
Avg merge
1d 7h
Merged PRs (30d)
490

Description

## Summary

In the current implementation of `createBrowserDownloadService` (added in #11437), downloads are triggered via an `` element click and immediately resolve as `completed` with no progress tracking. A follow-up improvement was identified to use `XMLHttpRequest` → `Blob` → `Object URL` to enable real download progress reporting for browser/localhost environments.

## Background

During review of #11437, @AustinMroz suggested the XHR + objectURL approach as a way to get actual progress events for browser-based downloads. The PR author (@christian-byrne) agreed this is a good idea for browser/localhost and captured it as a separate follow-up.

This is distinct from the cloud provider's `progressListeners` stub, which will be wired to WebSocket events in a separate follow-up PR.

## Proposed Work

- Replace or supplement the `` click approach in `src/platform/downloads/providers/createBrowserDownloadService.ts` with an `XMLHttpRequest` implementation
- Stream response to a `Blob`, then create an object URL for the final download trigger
- Fire `progressListeners` callbacks during XHR `progress` events so `onProgress` subscriptions receive real updates
- Update `supportsPauseResume` and relevant tests as needed
- Avoid routing through blobs for cloud downloads (only apply to browser/localhost)

## References

- PR: #11437
- Review comment: https://github.com/Comfy-Org/ComfyUI_frontend/pull/11437#discussion_r3113433534
- Requested by: @christian-byrne

┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-11872-feat-implement-XHR-objectURL-approach-for-browser-download-progress-in-createBrows-3556d73d36508164899ec81a0fac60f3) by [Unito](https://www.unito.io)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.