I've defined 2 preferences in the extension's config.xml file:
<preference name="interval" value="1800" readonly="false" />
<preference name="pcount" value="5" readonly="false" />
When I use the following to retrieve these value in the background.js script:
interval = widget.preferences.getItem("interval")
pcount = widget.preferences.getItem("pcount")
the values of interval and pcount variable becomes "null", rather than 1800 and 5.
What am I doing wrong?
To answer my own question:
This seems to be an Opera quirk. After some experiments, I found that if you restart Opera (after adding the extension) widget.preferences seems to store and retrieve the values. Sometimes you have to uninstall and install the extension again. Sometimes you have to clear the cache. Sometimes you have to do all.