Module: contentTypes

Members

(package, static, constant) ALLOWING_TYPES :number

Bitmask for "types" (flags) that are for exception rules only, like $document, $elemhide, and so on.

Type:
  • number
Source:

(static) contentTypes :Object

Content types for request blocking and allowing (allowlisting).

There are two kinds of content types: resource types, and special (non-resource) types.

Resource types include web resources like scripts, images, and so on.

Special types include filter options for popup blocking and CSP header injection as well as flags for allowing documents.

By default a filter matches any resource type, but if a filter has an explicit resource type, special option, or allowing flag, like $script, $popup, or $elemhide, then it matches only the given type, option, or flag.

Type:
  • Object
Source:

(package, static, constant) RESOURCE_TYPES :number

Bitmask for resource types like $script, $image, $stylesheet, and so on.

If a filter has no explicit content type, it applies to all resource types (but not to any special types).

Type:
  • number
Source:

(package, static, constant) SPECIAL_TYPES :number

Bitmask for special "types" (options and flags) like $csp, $elemhide, and so on.

Type:
  • number
Source:

(package, inner, constant) CONTEXT_TYPES :number

Bitmask for "types" that match against request context more than actual content type. When matching against context types, you should also include the request's resource type.

Type:
  • number
Source:

Methods

(generator, package, static) enumerateTypes(contentType, selectionopt) → {number}

Yields individual types from a filter's type mask.

Parameters:
Name Type Attributes Description
contentType number

A filter's type mask.

selection number <optional>

Which types to yield.

Source:
Yields:
Type
number