Common.Utils

Classes for your scripts

אין להתקין סקריפט זה ישירות. זוהי ספריה עבור סקריפטים אחרים // @require https://update.greasyforks.org/scripts/389765/1090053/CommonUtils.js

יוצר
Anton Shevchuk
גרסה
0.0.7
נוצר
04-09-2019
עודכן
05-09-2022
Size
3.33 קילו-בייט
רישיון
MIT

Common Utils

Require Script

// @require https://greasyforks.org/scripts/389765-common-utils/code/CommonUtils.js?version=XXX

See last available version on the GreasyFork homepage

Container

Cache

let CacheInstance = new SimpleCache();
let result = null;
if (CacheInstance.has('key')) {
  result = CacheInstance.get('key');
} else {
  result = await $.ajax('url');
  CacheInstance.set('key', result);
}

Settings

Load settings

let SettingsInstance = new Settings('script name', {'default':'settings'});

Save settings

With jQuery:

$(window).on('beforeunload', () => SettingsInstance.save() );

Links

Author homepage: http://anton.shevchuk.name/
Script homepage: https://github.com/AntonShevchuk/common.utils
GreasyFork: https://greasyforks.org/uk/scripts/389765-common-utils

长期地址
遇到问题?请前往 GitHub 提 Issues。