Classes for your scripts
สคริปต์นี้ไม่ควรถูกติดตั้งโดยตรง มันเป็นคลังสำหรับสคริปต์อื่น ๆ เพื่อบรรจุด้วยคำสั่งเมทา // @require https://update.greasyfork.org/scripts/389765/1090053/CommonUtils.js
// @require https://greasyfork.org/scripts/389765-common-utils/code/CommonUtils.js?version=XXX
See last available version on the GreasyFork homepage
let CacheInstance = new SimpleCache();
let r###lt = null;
if (CacheInstance.has('key')) {
r###lt = CacheInstance.get('key');
} else {
r###lt = await $.ajax('url');
CacheInstance.set('key', r###lt);
}
let SettingsInstance = new Settings('script name', {'default':'settings'});
With jQuery:
$(window).on('beforeunload', () => SettingsInstance.save() );
Author homepage: http://anton.shevchuk.name/
Script homepage: https://github.com/AntonShevchuk/common.utils
GreasyFork: https://greasyfork.org/uk/scripts/389765-common-utils