Instance Method

setItem

Sets the value of a key.

Declaration

void setItem(in DOMString key, in any value);

Parameters

key

The key whose value is being set.

value

The value being set.

Discussion

The behavior of this method is undefined if value cannot be serialized to a JSON value.

On success, this method dispatches a SafariExtensionSettingsChangeEvent event describing the change.

See Also

Reading and Writing Settings

getItem

Returns the current value of a key.