Module: snippets

Classes

Snippets

Members

(static) snippets :module:snippets~Snippets

Container for snippet filters.

Type:
Source:

Methods

(static) compileScript(scripts, isolatedSnippetsLibrary, injectedSnippetsLibrary, injectedSnippetsList, environmentopt) → {string}

Compiles a script against a given list of libraries, passed as JSON serialized string, or a an array of strings, into executable code.

Parameters:
Name Type Attributes Description
scripts string | Array.<string>

One or more scripts to convert into executable code.

isolatedSnippetsLibrary string

The stringified bundle to be executed in the isolated content script context.

injectedSnippetsLibrary string

The stringified bundle to be injected and executed in the main context.

injectedSnippetsList string | Array.<string>

An array containing the available injectable snippets.

environment object <optional>

An object containing environment variables.

Source:
Returns:

Executable code.

Type
string

(package, static) parseScript(script) → {Array.<Array.<string>>}

Parses a script and returns a list of all its commands and their arguments.

Parameters:
Name Type Description
script string

The script.

Source:
Returns:

A list of commands and their arguments.

Type
Array.<Array.<string>>