Expand description
net.fetch for sandboxed widgets
(docs/specs/SPEC_USER_WIDGETS_AND_WIDGET_API_2026_10_09.md §6.3).
srv makes the request, not the widget: no cookies, no proxy, no browser
profile, no AgentMux origin. The URL’s origin must match one of the
package’s net: grants, and so must every redirect. The host’s addresses
are resolved once and the connection is pinned to them, so a name can’t
resolve to one address for the check and another for the request. A
private or local address is reachable only through a grant that names it
as an IP address, or localhost for loopback, port included.
Structs§
- Fetch
Request - Fetch
Response - Grant 🔒
- One
net:grant, parsed.
Constants§
- CREDENTIAL_
HEADERS 🔒 - Headers dropped when a redirect leaves the origin they were sent to.
- DEFAULT_
TIMEOUT 🔒 - DNS_
TIMEOUT 🔒 - MAX_
REDIRECTS 🔒 - MAX_
REQUEST_ BYTES - MAX_
RESPONSE_ BYTES - MAX_
TIMEOUT 🔒 - REFUSED_
HEADERS 🔒 - Request headers a widget can’t set: srv sets them, or they’d change how the connection itself behaves.
Functions§
- fetch
- Makes the request for a package granted
granted. - grant_
for 🔒 - The grant among
grantedthat coversurl, if any. - is_text 🔒
- needed 🔒
- The permission a request to
urlneeds, named the way the manifest writes it (for the error). - parse_
grant 🔒 - read 🔒
- resolve 🔒
- The host’s addresses, looked up within
deadline(the request’s own timeout covers DNS too), each checked againstgrant. - url_
host 🔒