Skip to main content

Interface: INetworkApi

Defined in: Extensions/ExtensionApiTypes.ts:658

Methods

fetch()

fetch(url, init?): Promise<NetworkFetchResponse>

Defined in: Extensions/ExtensionApiTypes.ts:670

Mediated outbound HTTP/HTTPS request. The URL's host MUST appear in the extension's network.allowedHosts manifest entry; otherwise the call rejects with NetworkHostNotAllowedError even if network permission is granted.

Private-network destinations (loopback, RFC1918, link-local) are blocked by default. To target a private host, the extension must list a literal IP or hostname in allowedHosts and the user must approve it explicitly at install time (the consent dialog highlights private targets).

Parameters

url

string

init?

NetworkFetchInit

Returns

Promise<NetworkFetchResponse>


isHostAllowed()

isHostAllowed(host): Promise<boolean>

Defined in: Extensions/ExtensionApiTypes.ts:673

True if the host is currently in the extension's allowlist.

Parameters

host

string

Returns

Promise<boolean>