Class Matcher
Defined in: Matcher.jsm.
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
Matcher()
Blacklist/whitelist filter matching
|
| Field Attributes | Field Name and Description |
|---|---|
|
Lookup table for filters by their associated keyword
|
|
|
Lookup table for keywords by the filter text
|
| Method Attributes | Method Name and Description |
|---|---|
| <private> |
_checkEntryMatch(keyword, location, contentType, docDomain, thirdParty)
Checks whether the entries for a particular keyword match a URL
|
|
add(filter)
Adds a filter to the matcher
|
|
|
clear()
Removes all known filters
|
|
|
findKeyword(text)
Chooses a keyword to be associated with the filter
|
|
|
getKeywordForFilter(filter)
Returns the keyword used for a filter, null for unknown filters.
|
|
|
hasFilter(filter)
Checks whether a particular filter is being matched against.
|
|
|
matchesAny(location, contentType, docDomain, thirdParty)
Tests whether the URL matches any of the known filters
|
|
|
remove(filter)
Removes a filter from the matcher
|
Field Detail
{Object}
filterByKeyword
Lookup table for filters by their associated keyword
{Object}
keywordByFilter
Lookup table for keywords by the filter text
Method Detail
<private>
_checkEntryMatch(keyword, location, contentType, docDomain, thirdParty)
Checks whether the entries for a particular keyword match a URL
- Parameters:
- keyword
- location
- contentType
- docDomain
- thirdParty
add(filter)
Adds a filter to the matcher
- Parameters:
- {RegExpFilter} filter
clear()
Removes all known filters
{String}
findKeyword(text)
Chooses a keyword to be associated with the filter
- Parameters:
- {String} text
- text representation of the filter
- Returns:
- {String} keyword (might be empty string)
{String}
getKeywordForFilter(filter)
Returns the keyword used for a filter, null for unknown filters.
- Parameters:
- {RegExpFilter} filter
{Boolean}
hasFilter(filter)
Checks whether a particular filter is being matched against.
- Parameters:
- {RegExpFilter} filter
{RegExpFilter}
matchesAny(location, contentType, docDomain, thirdParty)
Tests whether the URL matches any of the known filters
- Parameters:
- {String} location
- URL to be tested
- {String} contentType
- content type identifier of the URL
- {String} docDomain
- domain name of the document that loads the URL
- {Boolean} thirdParty
- should be true if the URL is a third-party request
- Returns:
- {RegExpFilter} matching filter or null
remove(filter)
Removes a filter from the matcher
- Parameters:
- {RegExpFilter} filter