Skip to content

ElectronProtocol.interceptHttpProtocol method

ElectronProtocol › interceptHttpProtocol

Unofficial

Intercepts scheme and uses handler as the new handler which sends a new HTTP request as a response.

Signature:

interceptHttpProtocol(scheme: string, handler: (request: ElectronProtocolRequest, callback: (response: ElectronProtocolResponse) => void) => void): boolean

Parameters:

Parameter Type Description
scheme string The scheme to intercept.
handler (request: ElectronProtocolRequest, callback: (response: ElectronProtocolResponse) => void) => void Called with the request and a callback to send the response.

Returns: booleanWhether the protocol was successfully intercepted.