Skip to content

ElectronProtocol.registerFileProtocol method

ElectronProtocol › registerFileProtocol

Unofficial

Registers a protocol of scheme that will send a file as the response.

Signature:

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

Parameters:

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

Returns: booleanWhether the protocol was successfully registered.