firefox - How to add menuitem to menulist using add-on sdk programmatically? -
i have defined menulist in package.json:-
"preferences": [{ "name": "editor_url", "title": "editor url:", "type": "menulist", "value": 0, "options": [ { "value": "0", "label": "http://localhost:53421" } ] }] how can add options/menuitems menulist dynamically?
any appreciated. thanks
to "options" array added:
{ "value": "1", "label": "https://miskatonic.edu" } then tried following lib/main.js:
var preferences = require("sdk/simple-prefs").prefs: console.log(json.stringify(preferences)); preferences.editor_url = 1; console.log(json.stringify(preferences)); it didn't update preferences display in add-ons manager in real time, after closing , re-opening preferences add-on, other url displayed.
Comments
Post a Comment