Skip to content

ElectronProtocol.interceptStringProtocol method

ElectronProtocol › interceptStringProtocol

Unofficial

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

Signature:

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

Parameters:

ParameterTypeDescription
schemestringThe scheme to intercept.
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 intercepted.