Skip to content

[FireMonkey] New storage API options: getValue, setValue, deleteValue #545

@erosman

Description

@erosman

New APIs in FireMonkey 2.68 ...

New GM APIs: getValues, setValues, deleteValues

Userscripts often need to get/set multiple values. Each storage operation result in costly asynchronous read/write which means resources, time, and hard disk wear (especially for SSDs). These new APIs aim to alleviate the aforementioned.

Single-operation

await GM.setValue('key', 'value');
await GM.setValue('key2', 'value2');
await GM.setValue('key3', 'value3');
await GM.setValue('key4', 'value4');
await GM.setValue('key5', 'value5');

New Multi-operation (2.68 only)

const values = await GM.getValues([key, key2, ...]); // return {key: value, key2: value2, ...}
await GM.setValues({key: value, key2: value2, ...});
await GM.deleteValues([key, key2, ...]);

New Multi-operation (changed in 2.69 as new options for existing APIs)

const values = await GM.getValue([key, key2, ...]); // return {key: value, key2: value2, ...}
await GM.setValue({key: value, key2: value2, ...});
await GM.deleteValue([key, key2, ...]);

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions