Greasy Fork is available in English.

GM_config_lz-string

ConfigLzString/Refactor GM_config, this version uses lz-string to access data for a Library script

Этот скрипт недоступен для установки пользователем. Он является библиотекой, которая подключается к другим скриптам мета-ключом // @require https://update.greasyfork.org/scripts/372760/634230/GM_config_lz-string.js

Автор
avan
Версия
0.6
Создан
01.10.2018
Обновлён
05.10.2018
Лицензия
MIT

GMconfiglz-string

Refactor GM_config, this version uses lz-string to access data.

The original author was sizzlemctwizzle.


  • To include ConfigLzString(GM_config_lz-string) in a script use an @require
// ==UserScript==
// @name          Script Name
// @namespace     Script Namespace
// @require       https://cdnjs.cloudflare.com/ajax/libs/lz-string/1.4.4/lz-string.min.js
// @require       https://openuserjs.org/src/libs/sizzle/GM_config.js
// @require      https://greasyfork.org/scripts/372760-gm-config-lz-string/code/GM_config_lz-string.js
// @grant         GM_getValue
// @grant         GM_setValue
// ==/UserScript==

Rename GM_configStruct to ConfigLzString

const gmc = new ConfigLzString({
    'id': 'ID',
    'title': 'TITLE',
    'fields': {...},
    'events': {...},
    'css': '...',
    'src':'...', //Load the js source file in the head block of iframe
});

For the original version of GM_config usage information, read the wiki.