Skip to content

ElectronProtocol.registerHttpProtocol method

ElectronProtocol › registerHttpProtocol

Unofficial

Registers a protocol of scheme that will send an HTTP request as a response.

Signature:

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

Parameters:

ParameterTypeDescription
schemestringThe scheme to register.
handler(request: ElectronProtocolRequest, callback: (response: ElectronProtocolResponse) => void) => voidCalled with the request and a callback to send the response.

Returns: booleanWhether the protocol was successfully registered.