Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
3 tasks done
chrmarti opened this issue Sep 13, 2024 · 0 comments
Open
3 tasks done

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

chrmarti opened this issue Sep 13, 2024 · 0 comments

Comments

@chrmarti
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant