Description

Application storage for persisting data. This module is shared and can be used anywhere inside the extension (content script, background context, etc).

Details

Members


<static> keys

Description

Use keys to avoid typing string literals because storage keys are case sensitive.

Details

<private, static> storageImplementation

Description

Determine which storage implementation to use based on current browser.

Returns
  • storage implementation; either local or sync
Details

Methods


<private, static> parseKeywords( input )

Description

Convert blocked keywords string into an array

Parameters
Name Type Description
input
Returns
Details

<static> getSettings( callback )

Description

Get all user settings (except log)

Parameters
Name Type Description
callback function
Details

<static> getBlockCount( callback )

Description

Get number of blocks performed by this extension

Parameters
Name Type Description
callback function
Details

<static> setBlockedWords( words, done )

Description

Update the list of trigger keywords; this function will sanitize and strip the input

Parameters
Name Type Description
words string

list of words to block

done function

callback

Details

<static> setConfirmationSetting( value, done )

Description

Update confirmation prompt user preference

Parameters
Name Type Description
value Boolean

set true to ask user before blocking

done function

callback

Details

<static> incrementCount()

Description

Update the count of completed block requests

Details

<static> addWhiteList()

Description

Add new entry to whitelist

Details

<static> getLog( callback )

Description

Get the block log

Parameters
Name Type Description
callback function

current log

Details

<static> addLog( entry, callback )

Description

Update the block log

Parameters
Name Type Attributes Description
entry Object

entry to add to the log

callback function <nullable>

returns updated log

Details

<private, static> get( keys, callback )

Description

get some property from storage

Parameters
Name Type Description
keys String | Array.<String>

must be one of storage.keys or null. If null, entire contents of the storage will be returned.

callback function

function to call with result

Details

<private, static> save( key, value, callback )

Description

save some property in storage

Parameters
Name Type Description
key String

one of storage.keys

value *

value to save

callback function

called after save operation has completed

Details