Module implementing the AdBlock rule class.
None |
AdBlockRule | Class implementing the AdBlock rule. |
AdBlockRuleOption | Class implementing the rule option enum. |
AdBlockRuleType | Class implementing the rule type enum. |
toSecondLevelDomain | Module function to get a second level domain from the given URL. |
Class implementing the AdBlock rule.
None |
None |
AdBlockRule | Constructor |
__convertPatternToRegExp | Private method to convert a wildcard pattern to a regular expression. |
__filterIsOnlyDomain | Private method to check, if the given filter is a domain only filter. |
__filterIsOnlyEndsMatch | Private method to check, if the given filter is to match against the end of a string. |
__hasException | Private method to check, if the given option has been set as an exception. |
__hasOption | Private method to check, if the given option has been set. |
__isMatchingDomain | Private method to check, if a given domain matches the given filter string. |
__isMatchingRegExpStrings | Private method to check the given URL against the fixed parts of the regexp. |
__parseDomains | Private method to parse a string with a domain list. |
__parseFilter | Private method to parse the filter pattern. |
__parseRegExpFilter | Private method to split the given regular expression into strings that can be used with 'in'. |
__setException | Private method to set the given option as an exception. |
__stringMatch | Private method to match a domain string. |
addBlockedDomains | Public method to add to the list of blocked domains. |
allowedDomains | Public method to get a copy of the list of allowed domains. |
blockedDomains | Public method to get a copy of the list of blocked domains. |
caseSensitivity | Public method to get the case sensitivity. |
copyFrom | Public method to copy another AdBlock rule. |
cssSelector | Public method to get the CSS selector of the rule. |
filter | Public method to get the rule filter string. |
getRegExpAndMatchers | Public method to get the regular expression and associated string matchers. |
isCSSRule | Public method to check, if the rule is a CSS rule. |
isComment | Public method to check, if this is a comment. |
isDocument | Public method to check, if this is a document rule. |
isDomainRestricted | Public method to check, if this rule is restricted by domain. |
isElementHiding | Public method to check, if this is an element hiding rule. |
isEnabled | Public method to check, if the rule is enabled. |
isException | Public method to check, if the rule defines an exception. |
isHeader | Public method to check, if this is a header. |
isInternalDisabled | Public method to check, if this rule was disabled internally. |
isSlow | Public method to check, if this is a slow rule. |
matchDomain | Public method to match a domain. |
matchFont | Public method to match a Font rule. |
matchImage | Public method to match an Image rule. |
matchMedia | Public method to match a Media rule. |
matchObject | Public method to match an object rule. |
matchObjectSubrequest | Public method to match an Object Subrequest rule. |
matchOther | Public method to match any other rule. |
matchPing | Public method to match a Ping rule. |
matchScript | Public method to match a Script rule. |
matchString | Public method to get the match string. |
matchStyleSheet | Public method to match a StyleSheet rule. |
matchSubdocument | Public method to match a sub-document rule. |
matchThirdParty | Public method to match a third-party rule. |
matchXmlHttpRequest | Public method to match a XmlHttpRequest rule. |
networkMatch | Public method to check the rule for a match. |
ruleExceptions | Public method to get the rule exceptions. |
ruleOptions | Public method to get the rule options. |
ruleType | Public method to get the rule type. |
setEnabled | Public method to set the rule's enabled state. |
setException | Public method to set the rule's exception flag. |
setFilter | Public method to set the rule filter string. |
setOption | Public method to set the given option. |
setSubscription | Public method to set the subscription this rule belongs to. |
subscription | Public method to get the subscription this rule belongs to. |
urlMatch | Public method to check an URL against the rule. |
None |
Constructor
Private method to convert a wildcard pattern to a regular expression.
Private method to check, if the given filter is a domain only filter.
Private method to check, if the given filter is to match against the end of a string.
Private method to check, if the given option has been set as an exception.
Private method to check, if the given option has been set.
Private method to check, if a given domain matches the given filter string.
Private method to check the given URL against the fixed parts of the regexp.
Private method to parse a string with a domain list.
Private method to parse the filter pattern.
Private method to split the given regular expression into strings that can be used with 'in'.
Private method to set the given option as an exception.
Private method to match a domain string.
Public method to add to the list of blocked domains.
Public method to get a copy of the list of allowed domains.
Public method to get a copy of the list of blocked domains.
Public method to get the case sensitivity.
Public method to copy another AdBlock rule.
Public method to get the CSS selector of the rule.
Public method to get the rule filter string.
Public method to get the regular expression and associated string matchers.
Public method to check, if the rule is a CSS rule.
Public method to check, if this is a comment.
Public method to check, if this is a document rule.
Public method to check, if this rule is restricted by domain.
Public method to check, if this is an element hiding rule.
Public method to check, if the rule is enabled.
Public method to check, if the rule defines an exception.
Public method to check, if this is a header.
Public method to check, if this rule was disabled internally.
Public method to check, if this is a slow rule.
Public method to match a domain.
Public method to match a Font rule.
Public method to match an Image rule.
Public method to match a Media rule.
Public method to match an object rule.
Public method to match an Object Subrequest rule.
Public method to match any other rule.
Public method to match a Ping rule.
Public method to match a Script rule.
Public method to get the match string.
Public method to match a StyleSheet rule.
Public method to match a sub-document rule.
Public method to match a third-party rule.
Public method to match a XmlHttpRequest rule.
Public method to check the rule for a match.
Public method to get the rule exceptions.
Public method to get the rule options.
Public method to get the rule type.
Public method to set the rule's enabled state.
Public method to set the rule's exception flag.
Public method to set the rule filter string.
Public method to set the given option.
Public method to set the subscription this rule belongs to.
Public method to get the subscription this rule belongs to.
Public method to check an URL against the rule.
Class implementing the rule option enum.
DocumentOption |
DomainRestrictedOption |
ElementHideOption |
FontOption |
ImageOption |
MediaOption |
NoOption |
ObjectOption |
ObjectSubrequestOption |
OtherOption |
PingOption |
ScriptOption |
StyleSheetOption |
SubdocumentOption |
ThirdPartyOption |
XMLHttpRequestOption |
None |
None |
None |
Class implementing the rule type enum.
CssRule |
DomainMatchRule |
Invalid |
MatchAllUrlsRule |
RegExpMatchRule |
StringContainsMatchRule |
StringEndsMatchRule |
None |
None |
None |
Module function to get a second level domain from the given URL.