Firefox でユーザー設定にアクセスするにはどうすればよいですか? 次のコードがあります。
var control = document.getElementById(control_id);
if (control) {
control.setAttribute('color', nsPreferences.copyUnicharPref(prefstr, default_val));
}
しかし、これを実行すると、次のようになります。
Error: nsPreferences is not defined
Source file: chrome://backgroundtoggle/content/options.xul
Line: 9
Mozilla のドキュメントを読むのに苦労しています。これを私が望むようにするにはどうすればよいですか?