ElectronProtocol.interceptFileProtocol method
ElectronProtocol › interceptFileProtocol
Unofficial
Interceptsscheme and uses handler as the new handler which sends a file as a response. Signature:
interceptFileProtocol(scheme: string, handler: (request: ElectronProtocolRequest, callback: (response: string | ElectronProtocolResponse) => void) => void): booleanParameters:
| Parameter | Type | Description |
|---|---|---|
| scheme | string | The scheme to intercept. |
| handler | (request: ElectronProtocolRequest, callback: (response: string | ElectronProtocolResponse) => void) => void | Called with the request and a callback to send the response. |
Returns: boolean — Whether the protocol was successfully intercepted.