Module: content/elemHideEmulation

Classes

ElemHideEmulation

Methods

(static) setTestMode(options)

Enables test mode, which tracks additional metadata about the inner workings for test purposes. This also allows overriding internal configuration.

Parameters:
Name Type Description
options object
Properties
Name Type Description
minInvocationInterval number

Overrides how long must be waited between filter processing runs

maxSynchronousProcessingTime number

Overrides how long the thread may spend processing filters before it must yield its thread

Source:

(inner) newIdleDeadline() → {IdleDeadline}

Creates a new IdleDeadline.

Note: This function is synchronous and does NOT request an idle callback.

See https://developer.mozilla.org/en-US/docs/Web/API/IdleDeadline.

Source:
Returns:
Type
IdleDeadline

(inner) positionInParent(node) → {number}

Return position of node from parent.

Parameters:
Name Type Description
node Node

the node to find the position of.

Source:
Returns:

One-based index like for :nth-child(), or 0 on error.

Type
number

(inner) scopedQuerySelector(subtree, selector, allopt) → (nullable) {Node|NodeList}

Query selector.

If it is relative, will try :scope.

Parameters:
Name Type Attributes Default Description
subtree Node

the element to query selector

selector string

the selector to query

all bool <optional>
false

true to perform querySelectorAll()

Source:
Returns:

result of the query. null in case of error.

Type
Node | NodeList

(inner) stringifyStyle(rule) → {StringifiedStyle}

Produce a string representation of the stylesheet entry.

Parameters:
Name Type Description
rule CSSStyleRule

the CSS style rule.

Source:
Returns:

the stringified style.

Type
StringifiedStyle

(inner) yieldThread() → {Promise.<IdleDeadline>}

Returns a promise that is resolved when the browser is next idle.

This is intended to be used for long running tasks on the UI thread to allow other UI events to process.

Source:
Returns:

A promise that is fulfilled when you can continue processing

Type
Promise.<IdleDeadline>

Type Definitions

hideElemsFunc(elements, elementFilters)

Parameters:
Name Type Description
elements Array.<Node>

Elements on the page that should be hidden

elementFilters Array.<string>

The filter text that caused the elements to be hidden

Source:

StringifiedStyle

Stringified style objects

Type:
  • Object
Properties:
Name Type Description
style string

CSS style represented by a string.

subSelectors Array.<string>

selectors the CSS properties apply to.

Source:

unhideElemsFunc(elements)

Parameters:
Name Type Description
elements Array.<Node>

Elements on the page that should be hidden

Source: