Skip to content

ElectronWebRequest.onBeforeSendHeaders method

ElectronWebRequest › onBeforeSendHeaders

Unofficial

Registers a listener called before sending an HTTP request, once the request headers are available, filtered by filter.

Signature:

onBeforeSendHeaders(filter: ElectronWebRequestFilter, listener: ((details: ElectronOnBeforeSendHeadersListenerDetails, callback: (beforeSendResponse: ElectronBeforeSendResponse) => void) => void) | null): void

Parameters:

Parameter Type Description
filter ElectronWebRequestFilter The filter narrowing which requests are observed.
listener ((details: ElectronOnBeforeSendHeadersListenerDetails, callback: (beforeSendResponse: ElectronBeforeSendResponse) => void) => void) | null Called with the request details and a response callback, or null to remove the listener.

Returns: void


Unofficial

Registers a listener called before sending an HTTP request, once the request headers are available.

Signature:

onBeforeSendHeaders(listener: ((details: ElectronOnBeforeSendHeadersListenerDetails, callback: (beforeSendResponse: ElectronBeforeSendResponse) => void) => void) | null): void

Parameters:

Parameter Type Description
listener ((details: ElectronOnBeforeSendHeadersListenerDetails, callback: (beforeSendResponse: ElectronBeforeSendResponse) => void) => void) | null Called with the request details and a response callback, or null to remove the listener.

Returns: void