-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
I made a configFields
let actionList = ["hide", "filter"]
var configFields = {
"action": {
"label": "Action",
"type": "select",
"default": "filter",
"options": actionList
},
"filter": {
"label": "Filter",
"type": "text",
"default": "opacity(0.2)"
},
"timeToWatch": {
"label": "Time to watch",
"type": "number",
"default": 1000
},
"watchIfPreview": {
"label": "Watch if preview",
"type": "checkbox",
"default": false
},
"logging": {
"label": "Logging",
"type": "checkbox",
"default": true
}
}and initialized GM_config
GM_config.init({
id: "script-name_config",
title: "script name",
fields: configFields,
})then try to get the settings values
let action = GM_config.get("action")
let filter = GM_config.get("filter")
let timeToWatch = GM_config.get("timeToWatch")
let watchIfPreview = GM_config.get("watchIfPreview")
let logging = GM_config.get("logging")but getting Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'value'). So I'm guessing the default values aren't set automatically. How do I do it?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels