1. let prefManager = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch);
2. let url = prefManager.getIntPref("extensions.otr.serverIP");
However, instead of returning the preference value, line 2 throws an exception:
Error: NS_ERROR_UNEXPECTED: Component returned failure code: 0x8000ffff
(NS_ERROR_UNEXPECTED) [nsIPrefBranch.getIntPref]
Yeah, preferences in bootstrapped extensions work a little differently. Please see ui.setPrefs(); in ui.js. Let me know if what's there makes sense to you.
I'm trying to set up some default preferences for the add-on. This is the add-on directory structure:
And this is the content of
prefs.js
file:In the javascript file with the function I have
However, instead of returning the preference value, line 2 throws an exception:
Any ideas as to where I'm going wrong?