GM_config.js 668 B

123456789101112131415161718192021222324252627282930
  1. /* eslint-disable no-undef */
  2. // ==UserScript==
  3. // @require https://openuserjs.org/src/libs/sizzle/GM_config.js
  4. // @grant GM_getValue
  5. // @grant GM_setValue
  6. // ==/UserScript==
  7. GM_config.init(
  8. {
  9. "id": "MyConfig", // The id used for this instance of GM_config
  10. "title": "ayo",
  11. "fields": // Fields object
  12. {
  13. "name": // This is the id of the field
  14. {
  15. "label": "Name", // Appears next to field
  16. "type": "text", // Makes this setting a text field
  17. "default": "Sizzle McTwizzle" // Default value if user doesn"t change it
  18. }
  19. }
  20. });
  21. GM_config.open();
  22. GM_config.get("name");