KEMBAR78
[Bug]: Support URL as input for net.fetch · Issue #43712 · electron/electron · GitHub
Skip to content

[Bug]: Support URL as input for net.fetch #43712

@chrmarti

Description

@chrmarti

Preflight Checklist

Electron Version

30.4.0

What operating system(s) are you using?

macOS

Operating System Version

Sonoma

What arch are you using?

arm64 (including Apple Silicon)

Last Known Working Electron version

No response

Expected Behavior

Web API fetch is specified as also accepting an URL as the first parameter. Node.js' fetch supports URL. Electron's implementation appears to tolerate an URL. It would be very convenient to align with others and make what already works explicit in the typings.

Web API fetch: https://developer.mozilla.org/en-US/docs/Web/API/Window/fetch
Where I think Electron passes the first parameter in a way that accepts an URL:

req = new Request(input, init);

Actual Behavior

URL is missing from the docs that are used to generate electron.d.ts:

* `input` string | [GlobalRequest](https://nodejs.org/api/globals.html#request)

Testcase Gist URL

No response

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions