PluginStorage
Values kept in this browser for the plugin, as JSON in localStorage,
which a page shares and browsers cap at about 5 MB: keep them small.
Storage may be unavailable or full (a private window): then nothing is
kept, without an error, so read back what you rely on.
Methods
Section titled “Methods”delete()
Section titled “delete()”delete(key): Promise<void>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
key |
string |
Returns
Section titled “Returns”Promise<void>
get<T>(key): Promise<T | undefined>;A value as set; T says what you kept there, unchecked.
Type Parameters
Section titled “Type Parameters”| Type Parameter | Default type |
|---|---|
T |
JsonValue |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
key |
string |
Returns
Section titled “Returns”Promise<T | undefined>
set<T>(key, value): Promise<void>;Keeps a value JSON can hold: a list of objects, a string.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
T |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
key |
string |
value |
T |
Returns
Section titled “Returns”Promise<void>