common

Common functions and helpers.

Author:
License:
  • MPL-2.0
Source:
Author:
License:
  • MPL-2.0
Source:

Methods

(static) asyncGet(url, headers) → {Promise}

Wrapper around fetch api to return the URL fetched content as text

Source:
Parameters:
Name Type Description
url string

URL to fetch its content.

headers Object

Headers to add to the fetch request.

Returns:
Type:
Promise

Fetch promise with the response text as argument on success

(static) asyncGet(url, headers) → {Promise}

Wrapper around fetch api to return the URL fetched content as text

Source:
Parameters:
Name Type Description
url string

URL to fetch its content.

headers Object

Headers to add to the fetch request.

Returns:
Type:
Promise

Fetch promise with the response text as argument on success

(static) createNode(tag, properties, styles, dataset) → {HTMLElement}

Create new HTML element.

Source:
Parameters:
Name Type Description
tag string

Element tag name

properties Object

Mapping of element properties and its values

styles Object

Mapping of element styles to apply

dataset Object

Mapping of element data set.

Returns:
Type:
HTMLElement

The created element.

(static) createNode(tag, properties, styles, dataset) → {HTMLElement}

Create new HTML element.

Source:
Parameters:
Name Type Description
tag string

Element tag name

properties Object

Mapping of element properties and its values

styles Object

Mapping of element styles to apply

dataset Object

Mapping of element data set.

Returns:
Type:
HTMLElement

The created element.

(static) rmChildren(parent)

Remove HTML element all child elements

Source:
Parameters:
Name Type Description
parent HTMLElement

HTML element to remove it children

(static) rmChildren(parent)

Remove HTML element all child elements

Source:
Parameters:
Name Type Description
parent HTMLElement

HTML element to remove it children

(static) setClipboard(text)

Send setClipboard message to thebackground script with text to add to clipboard.

Deprecated:
  • Not ported to WebExtension api yet.
Source:
Parameters:
Name Type Description
text string

Text to add to clipboard.

(static) setClipboard(text)

Send setClipboard message to thebackground script with text to add to clipboard.

Deprecated:
  • Not ported to WebExtension api yet.
Source:
Parameters:
Name Type Description
text string

Text to add to clipboard.

Common functions and helpers.

Author:
License:
  • MPL-2.0
Source:
Author:
License:
  • MPL-2.0
Source:

Methods

(static) asyncGet(url, headers) → {Promise}

Wrapper around fetch api to return the URL fetched content as text

Source:
Parameters:
Name Type Description
url string

URL to fetch its content.

headers Object

Headers to add to the fetch request.

Returns:
Type:
Promise

Fetch promise with the response text as argument on success

(static) asyncGet(url, headers) → {Promise}

Wrapper around fetch api to return the URL fetched content as text

Source:
Parameters:
Name Type Description
url string

URL to fetch its content.

headers Object

Headers to add to the fetch request.

Returns:
Type:
Promise

Fetch promise with the response text as argument on success

(static) createNode(tag, properties, styles, dataset) → {HTMLElement}

Create new HTML element.

Source:
Parameters:
Name Type Description
tag string

Element tag name

properties Object

Mapping of element properties and its values

styles Object

Mapping of element styles to apply

dataset Object

Mapping of element data set.

Returns:
Type:
HTMLElement

The created element.

(static) createNode(tag, properties, styles, dataset) → {HTMLElement}

Create new HTML element.

Source:
Parameters:
Name Type Description
tag string

Element tag name

properties Object

Mapping of element properties and its values

styles Object

Mapping of element styles to apply

dataset Object

Mapping of element data set.

Returns:
Type:
HTMLElement

The created element.

(static) rmChildren(parent)

Remove HTML element all child elements

Source:
Parameters:
Name Type Description
parent HTMLElement

HTML element to remove it children

(static) rmChildren(parent)

Remove HTML element all child elements

Source:
Parameters:
Name Type Description
parent HTMLElement

HTML element to remove it children

(static) setClipboard(text)

Send setClipboard message to thebackground script with text to add to clipboard.

Deprecated:
  • Not ported to WebExtension api yet.
Source:
Parameters:
Name Type Description
text string

Text to add to clipboard.

(static) setClipboard(text)

Send setClipboard message to thebackground script with text to add to clipboard.

Deprecated:
  • Not ported to WebExtension api yet.
Source:
Parameters:
Name Type Description
text string

Text to add to clipboard.