Class Index | File Index

Classes


Class Matcher


Defined in: Matcher.jsm.

Class Summary
Constructor Attributes Constructor Name and Description
 
Blacklist/whitelist filter matching
Field Summary
Field Attributes Field Name and Description
 
Lookup table for filters by their associated keyword
 
Lookup table for keywords by the filter text
Method Summary
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
 
Removes all known filters
 
Chooses a keyword to be associated with the 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
Class Detail
Matcher()
Blacklist/whitelist filter matching
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

Documentation generated by JsDoc Toolkit 2.3.2 on Wed May 09 2012 10:50:20 GMT+0000 (UTC)