platform/electron/request-pipeline
Classes
Section titled “Classes”RequestPipeline
Section titled “RequestPipeline”Defined in: app/src/platform/electron/request-pipeline.ts:61
Owns the one onBeforeRequest and the one onHeadersReceived listener that Electron
allows per session and asks its interceptors in order: the first decision about a request
wins, and every interceptor may add response headers. Requests of the browser’s own pages
never pass here, because the pipeline only serves web sessions.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new RequestPipeline():
RequestPipeline
Returns
Section titled “Returns”Methods
Section titled “Methods”add(
interceptor):void
Defined in: app/src/platform/electron/request-pipeline.ts:68
Adds an interceptor after the existing ones.
Parameters
Section titled “Parameters”interceptor
Section titled “interceptor”The interceptor.
Returns
Section titled “Returns”void
attach()
Section titled “attach()”attach(
session):void
Defined in: app/src/platform/electron/request-pipeline.ts:76
Routes the requests of a web session through the pipeline.
Parameters
Section titled “Parameters”session
Section titled “session”Session
A session of web content.
Returns
Section titled “Returns”void
Interfaces
Section titled “Interfaces”RequestDecision
Section titled “RequestDecision”Defined in: app/src/platform/electron/request-pipeline.ts:8
What an interceptor decides about a request.
Properties
Section titled “Properties”cancel?
Section titled “cancel?”
readonlyoptionalcancel?:boolean
Defined in: app/src/platform/electron/request-pipeline.ts:10
Cancels the request.
redirectURL?
Section titled “redirectURL?”
readonlyoptionalredirectURL?:string
Defined in: app/src/platform/electron/request-pipeline.ts:12
Sends the request to another address instead.
RequestInterceptor
Section titled “RequestInterceptor”Defined in: app/src/platform/electron/request-pipeline.ts:19
One step of the request pipeline, such as the content blocker.
Methods
Section titled “Methods”beforeRequest()
Section titled “beforeRequest()”beforeRequest(
details):RequestDecision|Promise<RequestDecision|undefined> |undefined
Defined in: app/src/platform/electron/request-pipeline.ts:24
Decides about a request before it starts.
Parameters
Section titled “Parameters”details
Section titled “details”OnBeforeRequestListenerDetails
Returns
Section titled “Returns”RequestDecision | Promise<RequestDecision | undefined> | undefined
A decision, or undefined to let the next interceptor decide.
headersReceived()?
Section titled “headersReceived()?”
optionalheadersReceived(details):Readonly<Record<string, readonlystring[]>> |undefined
Defined in: app/src/platform/electron/request-pipeline.ts:31
Adds headers to a response, such as a content security policy.
Parameters
Section titled “Parameters”details
Section titled “details”OnHeadersReceivedListenerDetails
Returns
Section titled “Returns”Readonly<Record<string, readonly string[]>> | undefined
The headers to add, or undefined for none.
Type Aliases
Section titled “Type Aliases”HeaderAdditions
Section titled “HeaderAdditions”HeaderAdditions =
Readonly<Record<string, readonlystring[]>>
Defined in: app/src/platform/electron/request-pipeline.ts:16
Headers that an interceptor adds to a response.
Functions
Section titled “Functions”addHeaders()
Section titled “addHeaders()”addHeaders(
headers,additions):Record<string,string[]>
Defined in: app/src/platform/electron/request-pipeline.ts:40
The response headers with more values added. A header that exists under another spelling gets the values under its own name, so no value of the server is lost.
Parameters
Section titled “Parameters”headers
Section titled “headers”Readonly<Record<string, readonly string[]>>
The headers of the response.
additions
Section titled “additions”Values to add, by header name.
Returns
Section titled “Returns”Record<string, string[]>