Temporary-Script-Storage

Sets a maximum age (minimum one day) for script storage values, after which they are deleted

אין להתקין סקריפט זה ישירות. זוהי ספריה עבור סקריפטים אחרים // @require https://update.greasyfork.org/scripts/562172/1881822/Temporary-Script-Storage.js

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

יוצר
JasonMel
גרסה
1.0.4
נוצר
11-01-2026
עודכן
21-07-2026
Size
31.2 קילו-בייט
רישיון
MIT (https://mit-license.org/)

אחסון שנוצר והנגיש דרך מופע של מחלקה זו יחיה רק כל עוד תוקף החיים שהגדרת בבנאי, אם כי חייב להיות לפחות יום אחד. ברירת המחדל היא 30 ימים. לאחר זמן זה, הוא יפוג ויימחק כאשר sweepExpiredEntries() נקרא, שאתה יכול לתזמן עם setInterval().

לספרייה זו אין השפעה על אחסון סקריפט שנוצר ישירות דרך setValue() של GM בדרך הרגילה. אחסון כזה יתנהג בדרך כלל.

דוגמה לשימוש:

const persistentStorage = new TTLStorage();
await persistentStorage.ready();
setInterval(() => persistentStorage.sweepExpiredEntries(), 1000 * 60 * 60 * 24);

try { 
  await persistentStorage.set("key1", "hello"); // throws
  const msg = persistentStorage.get("key1");    // fast memory read
  await persistentStorage.delete("key1");       // throws
} catch {}

בנוסף, כל סקריפט המשתמש בספרייה זו חייב לכלול את המטא-דאטה הבא:

// @grant GM.getValue
// @grant GM.setValue
// @grant GM.deleteValue
// @grant GM.listValues
// @grant GM.info

זה הכרחי מכיוון שהצבת מה שכל ספרייה צריכה במטא-דאטה שלה אינה מספיקה. הסקריפט ברמה העליונה חייב לספק את ה-@requires וה-@grants הנדרשים לכל התלויות שלו.