Helo everybody.
Is there any way how to save ‘preference-set’ to prefs.xml with script ?
<preference-set id="foo-set">
</preference-set>
And how to set\get values in this preference set ?
Helo everybody.
Is there any way how to save ‘preference-set’ to prefs.xml with script ?
<preference-set id="foo-set">
</preference-set>
And how to set\get values in this preference set ?
It’s easier if you use the simple-storage
SDK to store persistent data in Komodo:
var ss= require("ko/simple-storage").get("myStorage").storage;
ss.foo = "bar";
ss.food = {"vege burger":"good", "pizza":"great"};
// some other piece of code that needs this info
console.log(ss.food.pizza);
To use prefs:
var prefSet = Components.classes['@activestate.com/koPreferenceSet;1'].createInstance();
var globalPrefs = require("ko/prefs");
globalPrefs.setPref("foo-set", prefSet);
//Then you can add stuff to that a prefSet
prefSet.setStringPref("blah","blah");
console.log(prefSet.getStringPref("blah"));
Thank You very much Careyh.
It works nice.