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:

ParameterTypeDescription
filterElectronWebRequestFilterThe filter narrowing which requests are observed.
listener((details: ElectronOnBeforeSendHeadersListenerDetails, callback: (beforeSendResponse: ElectronBeforeSendResponse) => void) => void) | nullCalled 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:

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

Returns: void