events.UrlFilter

Filters URLs for various criteria. See event filtering. All criteria are case sensitive.

Type

Values of this type are objects. They contain the following properties:

hostContainsOptional
string. Matches if the host name of the URL contains a specified string. To test whether a host name component has a prefix 'foo', use hostContains: '.foo'. This matches 'www.foobar.com' and 'foo.com', because an implicit dot is added at the beginning of the host name. Similarly, hostContains can be used to match against component suffix ('foo.') and to exactly match against components ('.foo.'). Suffix- and exact-matching for the last components need to be done separately using hostSuffix, because no implicit dot is added at the end of the host name.
hostEqualsOptional
string. Matches if the host name of the URL is equal to a specified string.
hostPrefixOptional
string. Matches if the host name of the URL starts with a specified string.
hostSuffixOptional
string. Matches if the host name of the URL ends with a specified string.
pathContainsOptional
string. Matches if the path segment of the URL contains a specified string.
pathEqualsOptional
string. Matches if the path segment of the URL is equal to a specified string.
pathPrefixOptional
string. Matches if the path segment of the URL starts with a specified string.
pathSuffixOptional
string. Matches if the path segment of the URL ends with a specified string.
queryContainsOptional
string. Matches if the query segment of the URL contains a specified string.
queryEqualsOptional
string. Matches if the query segment of the URL is equal to a specified string.
queryPrefixOptional
string. Matches if the query segment of the URL starts with a specified string.
querySuffixOptional
string. Matches if the query segment of the URL ends with a specified string.
urlContainsOptional
string. Matches if the URL (without fragment identifier) contains a specified string. Port numbers are stripped from the URL if they match the default port number.
urlEqualsOptional
string. Matches if the URL (without fragment identifier) is equal to a specified string. Port numbers are stripped from the URL if they match the default port number.
urlMatchesOptional
string. Matches if the URL (without fragment identifier) matches a specified regular expression. Port numbers are stripped from the URL if they match the default port number. The regular expressions use the RE2 syntax.
originAndPathMatchesOptional
string. Matches if the URL without query segment and fragment identifier matches a specified regular expression. Port numbers are stripped from the URL if they match the default port number. The regular expressions use the RE2 syntax.
urlPrefixOptional
string. Matches if the URL (without fragment identifier) starts with a specified string. Port numbers are stripped from the URL if they match the default port number.
urlSuffixOptional
string. Matches if the URL (without fragment identifier) ends with a specified string. Port numbers are stripped from the URL if they match the default port number.
schemesOptional
array of string. Matches if the scheme of the URL is equal to any of the schemes specified in the array.
portsOptional
array of integer or array of integer. Matches if the port of the URL is contained in any of the specified port lists. For example [80, 443, [1000, 1200]] matches all requests on port 80, 443 and in the range 1000-1200.

Browser compatibility

EdgeFirefoxChromeOpera
Basic support?NoYes33
Firefox
Basic supportNo

Acknowledgements

This API is based on Chromium's chrome.events API. This documentation is derived from events.json in the Chromium code.

Document Tags and Contributors

 Contributors to this page: wbamberg
 Last updated by: wbamberg,