Sets a maximum age (minimum one day) for script storage values, after which they are deleted
Този скрипт не може да бъде инсталиран директно. Това е библиотека за други скриптове и може да бъде използвана с мета-директива // @require https://update.greasyfork.org/scripts/562172/1732034/Temporary-Script-Storage.js
Пример за използване:
const persistentStorage = new TTLStorage();
await persistentStorage.ready();
setInterval(() => persistentStorage.sweepExpiredEntries(), 1000 * 60 * 60 * 24);
persistentStorage.set("key1", "hello");
const msg = persistentStorage.get("key1");