Module: elemHide

Classes

ElemHide

Members

(static) elemHide :module:elemHide~ElemHide

Container for element hiding filters.

Type:
Source:

Methods

(static) createStyleSheet(selectors, declarationBlockopt) → {string}

Creates an element hiding CSS style sheet from a given list of selectors.

Parameters:
Name Type Attributes Description
selectors Array.<string>

The list of selectors.

declarationBlock string <optional>

Optional CSS code to use as the declaration block. By default, the code {display: none !important;} is used. If specified, the value is injected as-is into the style sheet.

Source:
Returns:

A CSS style sheet.

Type
string

(generator, static) rulesFromStyleSheet(styleSheet) → {string}

Yields rules from a style sheet returned by createStyleSheet().

Parameters:
Name Type Description
styleSheet string

A style sheet returned by createStyleSheet(). If the given style sheet is not a value previously returned by a call to createStyleSheet(), the behavior is undefined.

Source:
Yields:
A rule from the given style sheet.
Type
string

(inner) createRule(selector, declarationBlockopt) → {string}

Creates an element hiding CSS rule for a given list of selectors.

Parameters:
Name Type Attributes Default Description
selector string

The CSS selector for the rule.

declarationBlock string <optional>
{display: none !important;}

Optional CSS code to use as the declaration block. By default, the code {display: none !important;} is used. If specified, the value is injected as-is into the rule.

Source:
Returns:

A CSS rule.

Type
string

(inner) escapeSelector(selector) → {string}

Escapes curly braces to prevent CSS rule injection.

Parameters:
Name Type Description
selector string
Source:
Returns:
Type
string

Type Definitions

ElemHideStyleSheet

Type:
  • Object
Properties:
Name Type Attributes Description
code string

CSS code.

selectors Array.<string> <nullable>

List of selectors.

exceptions Array.<string> <nullable>

List of exceptions.

Source: