BlockingResponse class
Returns value for event handlers that have the 'blocking' extraInfoSpec applied. Allows the event handler to modify network requests.
class BlockingResponse extends ChromeObject { BlockingResponse({bool cancel, String redirectUrl, HttpHeaders requestHeaders, HttpHeaders responseHeaders, AuthCredentialsWebRequest authCredentials}) { if (cancel != null) this.cancel = cancel; if (redirectUrl != null) this.redirectUrl = redirectUrl; if (requestHeaders != null) this.requestHeaders = requestHeaders; if (responseHeaders != null) this.responseHeaders = responseHeaders; if (authCredentials != null) this.authCredentials = authCredentials; } BlockingResponse.fromProxy(JsObject jsProxy): super.fromProxy(jsProxy); /** * If true, the request is cancelled. Used in onBeforeRequest, this prevents * the request from being sent. */ bool get cancel => jsProxy['cancel']; set cancel(bool value) => jsProxy['cancel'] = value; /** * Only used as a response to the onBeforeRequest event. If set, the original * request is prevented from being sent and is instead redirected to the given * URL. */ String get redirectUrl => jsProxy['redirectUrl']; set redirectUrl(String value) => jsProxy['redirectUrl'] = value; /** * Only used as a response to the onBeforeSendHeaders event. If set, the * request is made with these request headers instead. */ HttpHeaders get requestHeaders => _createHttpHeaders(jsProxy['requestHeaders']); set requestHeaders(HttpHeaders value) => jsProxy['requestHeaders'] = jsify(value); /** * Only 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). */ HttpHeaders get responseHeaders => _createHttpHeaders(jsProxy['responseHeaders']); set responseHeaders(HttpHeaders value) => jsProxy['responseHeaders'] = jsify(value); /** * Only used as a response to the onAuthRequired event. If set, the request is * made using the supplied credentials. */ AuthCredentialsWebRequest get authCredentials => _createAuthCredentialsWebRequest(jsProxy['authCredentials']); set authCredentials(AuthCredentialsWebRequest value) => jsProxy['authCredentials'] = jsify(value); }
Extends
ChromeObject > BlockingResponse
Constructors
new BlockingResponse({bool cancel, String redirectUrl, HttpHeaders requestHeaders, HttpHeaders responseHeaders, AuthCredentialsWebRequest authCredentials}) #
Create a new instance of a ChromeObject
, which creates and delegates to
a JsObject proxy.
BlockingResponse({bool cancel, String redirectUrl, HttpHeaders requestHeaders, HttpHeaders responseHeaders, AuthCredentialsWebRequest authCredentials}) { if (cancel != null) this.cancel = cancel; if (redirectUrl != null) this.redirectUrl = redirectUrl; if (requestHeaders != null) this.requestHeaders = requestHeaders; if (responseHeaders != null) this.responseHeaders = responseHeaders; if (authCredentials != null) this.authCredentials = authCredentials; }
new BlockingResponse.fromProxy(JsObject jsProxy) #
Create a new instance of a ChromeObject
, which delegates to the given
JsObject proxy.
BlockingResponse.fromProxy(JsObject jsProxy): super.fromProxy(jsProxy);
Properties
AuthCredentialsWebRequest authCredentials #
Only used as a response to the onAuthRequired event. If set, the request is made using the supplied credentials.
AuthCredentialsWebRequest get authCredentials => _createAuthCredentialsWebRequest(jsProxy['authCredentials']);
set authCredentials(AuthCredentialsWebRequest value) => jsProxy['authCredentials'] = jsify(value);
bool cancel #
If true, the request is cancelled. Used in onBeforeRequest, this prevents the request from being sent.
bool get cancel => jsProxy['cancel'];
set cancel(bool value) => jsProxy['cancel'] = value;
String redirectUrl #
Only used as a response to the onBeforeRequest event. If set, the original request is prevented from being sent and is instead redirected to the given URL.
String get redirectUrl => jsProxy['redirectUrl'];
set redirectUrl(String value) => jsProxy['redirectUrl'] = value;
HttpHeaders requestHeaders #
Only used as a response to the onBeforeSendHeaders event. If set, the request is made with these request headers instead.
HttpHeaders get requestHeaders => _createHttpHeaders(jsProxy['requestHeaders']);
set requestHeaders(HttpHeaders value) => jsProxy['requestHeaders'] = jsify(value);
HttpHeaders responseHeaders #
Only 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).
HttpHeaders get responseHeaders => _createHttpHeaders(jsProxy['responseHeaders']);
set responseHeaders(HttpHeaders value) => jsProxy['responseHeaders'] = jsify(value);
Methods
String toString() #
Returns a string representation of this object.
String toString() => jsProxy.toString();