RequestMatcher class
Matches network events by various criteria.
class RequestMatcher extends ChromeObject { RequestMatcher({UrlFilter url, UrlFilter firstPartyForCookiesUrl, List<String> resourceType, List<String> contentType, List<String> excludeContentType, List<HeaderFilter> requestHeaders, List<HeaderFilter> excludeRequestHeaders, List<HeaderFilter> responseHeaders, List<HeaderFilter> excludeResponseHeaders, bool thirdPartyForCookies, List<String> stages}) { if (url != null) this.url = url; if (firstPartyForCookiesUrl != null) this.firstPartyForCookiesUrl = firstPartyForCookiesUrl; if (resourceType != null) this.resourceType = resourceType; if (contentType != null) this.contentType = contentType; if (excludeContentType != null) this.excludeContentType = excludeContentType; if (requestHeaders != null) this.requestHeaders = requestHeaders; if (excludeRequestHeaders != null) this.excludeRequestHeaders = excludeRequestHeaders; if (responseHeaders != null) this.responseHeaders = responseHeaders; if (excludeResponseHeaders != null) this.excludeResponseHeaders = excludeResponseHeaders; if (thirdPartyForCookies != null) this.thirdPartyForCookies = thirdPartyForCookies; if (stages != null) this.stages = stages; } RequestMatcher.fromProxy(JsObject jsProxy): super.fromProxy(jsProxy); /** * Matches if the conditions of the UrlFilter are fulfilled for the URL of the * request. */ UrlFilter get url => _createUrlFilter(jsProxy['url']); set url(UrlFilter value) => jsProxy['url'] = jsify(value); /** * Matches if the conditions of the UrlFilter are fulfilled for the 'first * party' URL of the request. The 'first party' URL of a request, when * present, can be different from the request's target URL, and describes what * is considered 'first party' for the sake of third-party checks for cookies. */ UrlFilter get firstPartyForCookiesUrl => _createUrlFilter(jsProxy['firstPartyForCookiesUrl']); set firstPartyForCookiesUrl(UrlFilter value) => jsProxy['firstPartyForCookiesUrl'] = jsify(value); /** * Matches if the request type of a request is contained in the list. Requests * that cannot match any of the types will be filtered out. */ List<String> get resourceType => listify(jsProxy['resourceType']); set resourceType(List<String> value) => jsProxy['resourceType'] = jsify(value); /** * Matches if the MIME media type of a response (from the HTTP Content-Type * header) is contained in the list. */ List<String> get contentType => listify(jsProxy['contentType']); set contentType(List<String> value) => jsProxy['contentType'] = jsify(value); /** * Matches if the MIME media type of a response (from the HTTP Content-Type * header) is _not_ contained in the list. */ List<String> get excludeContentType => listify(jsProxy['excludeContentType']); set excludeContentType(List<String> value) => jsProxy['excludeContentType'] = jsify(value); /** * Matches if some of the request headers is matched by one of the * HeaderFilters. */ List<HeaderFilter> get requestHeaders => listify(jsProxy['requestHeaders'], _createHeaderFilter); set requestHeaders(List<HeaderFilter> value) => jsProxy['requestHeaders'] = jsify(value); /** * Matches if none of the request headers is matched by any of the * HeaderFilters. */ List<HeaderFilter> get excludeRequestHeaders => listify(jsProxy['excludeRequestHeaders'], _createHeaderFilter); set excludeRequestHeaders(List<HeaderFilter> value) => jsProxy['excludeRequestHeaders'] = jsify(value); /** * Matches if some of the response headers is matched by one of the * HeaderFilters. */ List<HeaderFilter> get responseHeaders => listify(jsProxy['responseHeaders'], _createHeaderFilter); set responseHeaders(List<HeaderFilter> value) => jsProxy['responseHeaders'] = jsify(value); /** * Matches if none of the response headers is matched by any of the * HeaderFilters. */ List<HeaderFilter> get excludeResponseHeaders => listify(jsProxy['excludeResponseHeaders'], _createHeaderFilter); set excludeResponseHeaders(List<HeaderFilter> value) => jsProxy['excludeResponseHeaders'] = jsify(value); /** * If set to true, matches requests that are subject to third-party cookie * policies. If set to false, matches all other requests. */ bool get thirdPartyForCookies => jsProxy['thirdPartyForCookies']; set thirdPartyForCookies(bool value) => jsProxy['thirdPartyForCookies'] = value; /** * Contains a list of strings describing stages. Allowed values are * 'onBeforeRequest', 'onBeforeSendHeaders', 'onHeadersReceived', * 'onAuthRequired'. If this attribute is present, then it limits the * applicable stages to those listed. Note that the whole condition is only * applicable in stages compatible with all attributes. */ List<String> get stages => listify(jsProxy['stages']); set stages(List<String> value) => jsProxy['stages'] = jsify(value); }
Extends
ChromeObject > RequestMatcher
Constructors
new RequestMatcher({UrlFilter url, UrlFilter firstPartyForCookiesUrl, List<String> resourceType, List<String> contentType, List<String> excludeContentType, List<HeaderFilter> requestHeaders, List<HeaderFilter> excludeRequestHeaders, List<HeaderFilter> responseHeaders, List<HeaderFilter> excludeResponseHeaders, bool thirdPartyForCookies, List<String> stages}) #
Create a new instance of a ChromeObject
, which creates and delegates to
a JsObject proxy.
RequestMatcher({UrlFilter url, UrlFilter firstPartyForCookiesUrl, List<String> resourceType, List<String> contentType, List<String> excludeContentType, List<HeaderFilter> requestHeaders, List<HeaderFilter> excludeRequestHeaders, List<HeaderFilter> responseHeaders, List<HeaderFilter> excludeResponseHeaders, bool thirdPartyForCookies, List<String> stages}) { if (url != null) this.url = url; if (firstPartyForCookiesUrl != null) this.firstPartyForCookiesUrl = firstPartyForCookiesUrl; if (resourceType != null) this.resourceType = resourceType; if (contentType != null) this.contentType = contentType; if (excludeContentType != null) this.excludeContentType = excludeContentType; if (requestHeaders != null) this.requestHeaders = requestHeaders; if (excludeRequestHeaders != null) this.excludeRequestHeaders = excludeRequestHeaders; if (responseHeaders != null) this.responseHeaders = responseHeaders; if (excludeResponseHeaders != null) this.excludeResponseHeaders = excludeResponseHeaders; if (thirdPartyForCookies != null) this.thirdPartyForCookies = thirdPartyForCookies; if (stages != null) this.stages = stages; }
new RequestMatcher.fromProxy(JsObject jsProxy) #
Create a new instance of a ChromeObject
, which delegates to the given
JsObject proxy.
RequestMatcher.fromProxy(JsObject jsProxy): super.fromProxy(jsProxy);
Properties
List<String> contentType #
Matches if the MIME media type of a response (from the HTTP Content-Type header) is contained in the list.
List<String> get contentType => listify(jsProxy['contentType']);
set contentType(List<String> value) => jsProxy['contentType'] = jsify(value);
List<String> excludeContentType #
Matches if the MIME media type of a response (from the HTTP Content-Type header) is not contained in the list.
List<String> get excludeContentType => listify(jsProxy['excludeContentType']);
set excludeContentType(List<String> value) => jsProxy['excludeContentType'] = jsify(value);
List<HeaderFilter> excludeRequestHeaders #
Matches if none of the request headers is matched by any of the HeaderFilters.
List<HeaderFilter> get excludeRequestHeaders => listify(jsProxy['excludeRequestHeaders'], _createHeaderFilter);
set excludeRequestHeaders(List<HeaderFilter> value) => jsProxy['excludeRequestHeaders'] = jsify(value);
List<HeaderFilter> excludeResponseHeaders #
Matches if none of the response headers is matched by any of the HeaderFilters.
List<HeaderFilter> get excludeResponseHeaders => listify(jsProxy['excludeResponseHeaders'], _createHeaderFilter);
set excludeResponseHeaders(List<HeaderFilter> value) => jsProxy['excludeResponseHeaders'] = jsify(value);
UrlFilter firstPartyForCookiesUrl #
Matches if the conditions of the UrlFilter are fulfilled for the 'first party' URL of the request. The 'first party' URL of a request, when present, can be different from the request's target URL, and describes what is considered 'first party' for the sake of third-party checks for cookies.
UrlFilter get firstPartyForCookiesUrl => _createUrlFilter(jsProxy['firstPartyForCookiesUrl']);
set firstPartyForCookiesUrl(UrlFilter value) => jsProxy['firstPartyForCookiesUrl'] = jsify(value);
List<HeaderFilter> requestHeaders #
Matches if some of the request headers is matched by one of the HeaderFilters.
List<HeaderFilter> get requestHeaders => listify(jsProxy['requestHeaders'], _createHeaderFilter);
set requestHeaders(List<HeaderFilter> value) => jsProxy['requestHeaders'] = jsify(value);
List<String> resourceType #
Matches if the request type of a request is contained in the list. Requests that cannot match any of the types will be filtered out.
List<String> get resourceType => listify(jsProxy['resourceType']);
set resourceType(List<String> value) => jsProxy['resourceType'] = jsify(value);
List<HeaderFilter> responseHeaders #
Matches if some of the response headers is matched by one of the HeaderFilters.
List<HeaderFilter> get responseHeaders => listify(jsProxy['responseHeaders'], _createHeaderFilter);
set responseHeaders(List<HeaderFilter> value) => jsProxy['responseHeaders'] = jsify(value);
List<String> stages #
Contains a list of strings describing stages. Allowed values are 'onBeforeRequest', 'onBeforeSendHeaders', 'onHeadersReceived', 'onAuthRequired'. If this attribute is present, then it limits the applicable stages to those listed. Note that the whole condition is only applicable in stages compatible with all attributes.
List<String> get stages => listify(jsProxy['stages']);
set stages(List<String> value) => jsProxy['stages'] = jsify(value);
bool thirdPartyForCookies #
If set to true, matches requests that are subject to third-party cookie policies. If set to false, matches all other requests.
bool get thirdPartyForCookies => jsProxy['thirdPartyForCookies'];
set thirdPartyForCookies(bool value) => jsProxy['thirdPartyForCookies'] = value;
Methods
String toString() #
Returns a string representation of this object.
String toString() => jsProxy.toString();