moderator-toolbox-nxg-for-reddit / background/handlers/containerRequest

background/handlers/containerRequest

Functions

containerTargetFor()

containerTargetFor(sender): ContainerTarget | undefined

Defined in: extension/data/background/handlers/containerRequest.ts:34

Returns where to forward a request from sender, or undefined when the background can send it itself: Chrome, no tab, or the default container. Derived only from the trusted sender.

Parameters

sender

MessageSender

Returns

ContainerTarget | undefined


fetchInContainer()

fetchInContainer(target, url, init): Promise<Response>

Defined in: extension/data/background/handlers/containerRequest.ts:59

Performs url with init from the target frame, so it carries the container’s cookies.

Parameters

target

ContainerTarget

url

string

init

ForwardedRequestInit

Returns

Promise<Response>


requestTokenInContainer()

requestTokenInContainer(target, csrfToken): Promise<Response>

Defined in: extension/data/background/handlers/containerRequest.ts:68

Requests an OAuth token from the target frame, as the page, using the container’s CSRF token.

Parameters

target

ContainerTarget

csrfToken

string

Returns

Promise<Response>

Interfaces

ContainerTarget

Defined in: extension/data/background/handlers/containerRequest.ts:21

The frame a container request is forwarded to, and the cookie store it belongs to.

Properties

cookieStoreId

cookieStoreId: string

Defined in: extension/data/background/handlers/containerRequest.ts:27

Cookie store (container) of the tab, used for background cookie lookups.

frameId

frameId: number

Defined in: extension/data/background/handlers/containerRequest.ts:25

Frame within that tab that sent the request (0 is the top frame).

tabId

tabId: number

Defined in: extension/data/background/handlers/containerRequest.ts:23

Tab that sent the request.