Optionaldetails: RequestDetailsOptionalauthOnly used as a response to the onAuthRequired event. If set, the request is made using the supplied credentials.
Whether to cancel the request. Defaults to true, so that a listener that throws, or never completes its checks, cancels the request. Set to false to signal successful completion.
OptionalredirectOnly used as a response to the onBeforeRequest and onHeadersReceived events. If set, the original request is prevented from being sent/completed and is instead redirected to the given URL. Redirections to non-HTTP schemes such as data: are allowed. Redirects initiated by a redirect action use the original request method for the redirect, with one exception: If the redirect is initiated at the onHeadersReceived stage, then the redirect will be issued using the GET method.
OptionalrequestOnly used as a response to the onBeforeSendHeaders event. If set, the request is made with these request headers instead.
OptionalresponseOnly used as a response to the onHeadersReceived event. If set, the server is assumed to have responded with these response headers instead. Only return responseHeaders if you really want to modify the headers in order to limit the number of conflicts (only one extension may modify responseHeaders for each request).
OptionalupgradeOnly used as a response to the onBeforeRequest event. If set, the original request is prevented from being sent/completed and is instead upgraded to a secure request. If any extension returns redirectUrl during onBeforeRequest, upgradeToSecure will have no affect.
Implements the Disposable interface.
A Promise that resolves to this BlockingResponse after disposal.
An object whose properties are copied to this BlockingResponse.
Sets the response header name to value, replacing any existing
occurrences. Starts from the response's original headers, so the rest
pass through unchanged.
The response of a single listener to a blocking RequestEvent, created with RequestEvent.createBlockingResponse. Implements the Disposable interface. A new BlockingResponse cancels the request; a listener signals successful completion by setting cancel to false, either by assigning to it directly or with the set method. A listener must create it with a using declaration before its first await expression; the response is reported on disposal.
Example