Namespace: Utils

Utils

Utility methods

Source:

Members


<private, static, constant> _DEBUG :boolean

Set to true if development build

Type:
  • boolean
Source:

<static> DEBUG :boolean

True if development build

Type:
  • boolean
Source:

Methods


<static> getChromeVersion() → {int}

Get the Chrome version

Source:
See:
Returns:

Chrome major version

Type
int

<static> getExtensionName() → {string}

Get the extension's name

Source:
Returns:

Extension name

Type
string

<static> getFullChromeVersion() → {string}

Get the full Chrome version

Source:
See:
Returns:

Chrome version

Type
string

<static> getPlatformOS() → {Promise.<string>}

Get the OS as a human readable string

Source:
Returns:

OS name

Type
Promise.<string>

<static> getRandomInt(min, max) → {int}

Returns a random integer between min and max inclusive

Parameters:
Name Type Description
min int

min value

max int

max value

Source:
Returns:

random int

Type
int

<static> getRandomString( [len]) → {string}

Get a random string of the given length

Parameters:
Name Type Argument Default Description
len int <optional>
8

length of generated string

Source:
Returns:

a random string

Type
string

<static> getVersion() → {string}

Get the Extension version

Source:
Returns:

Extension version

Type
string

<static> isChromeOS() → {Promise.<boolean>}

Determine if we are Chrome OS

Source:
Returns:

true if ChromeOS

Type
Promise.<boolean>

<static> isMac() → {Promise.<boolean>}

Determine if we are a Mac

Source:
Returns:

true if Mac

Type
Promise.<boolean>

<static> isWhiteSpace(str) → {boolean}

Determine if a String is null or whitespace only

Parameters:
Name Type Argument Description
str string <nullable>

string to check

Source:
Returns:

true is str is whitespace or null

Type
boolean

<static> isWindows() → {Promise.<boolean>}

Determine if we are MS windows

Source:
Returns:

true if MS Windows

Type
Promise.<boolean>

<static> noop()

No operation

Source:

<static> shuffleArray(array)

Randomly sort an Array in place Fisher-Yates shuffle algorithm.

Parameters:
Name Type Description
array Array

Array to sort

Source: