[whatwg/dom] downloads.download() should be appear in the API (Issue #1438)

NagayamaToshiaki created an issue (whatwg/dom#1438)

### What problem are you trying to solve?

Downloading a file via JavaScript is au usual thing. For example, you `fetch()` something then download its blob. But how to do it is still cumbersome.

### What solutions exist today?

1. create an `<a>` element.
2. assign attributes; `href`, `download` and so on.
3. fire `click()` event via JavaScript.
4. remove the `<a>` element.

What an ugly, hacky way! Downloading via JavaScript should be easier.

### How would you solve it?

Most browser extensions have [`downloads.download()`](https://developer.mozilla.org/ja/docs/Mozilla/Add-ons/WebExtensions/API/downloads/download) method. Why can't we use this syntax?

### Anything else?

_No response_

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/1438
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/dom/issues/1438@github.com>

Received on Friday, 12 December 2025 06:23:37 UTC