如何在 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 文档时遇到了麻烦。我如何让它做我想要的?