FireFox nsFormAutoComplete.js为getBoolPref()存储的“设置”在哪里?

时间:2010-05-27 15:13:27

标签: firefox javascript

当我使用FireFox(3.6.3)在页面上的各种文本框中键入文本时,出现以下错误:

错误:[Exception ...“组件返回失败代码:0x8000ffff(NS_ERROR_UNEXPECTED)[nsIPrefBranch.getBoolPref]”nsresult:“0x8000ffff(NS_ERROR_UNEXPECTED)”location:“JS frame :: file:/// C:/ Program %20Files / Mozilla%20Firefox / components / nsFormAutoComplete.js :: anonymous :: line 97“data:no] 源文件:file:/// C:/Program%20Files/Mozilla%20Firefox/components/nsFormAutoComplete.js 行:97

对于我开发的网页,甚至在Google搜索栏中输入文字,似乎都会发生。

当我查看nsFormAutoComplete.js时,我看到了:

init : function() {
    // Preferences. Add observer so we get notified of changes.
    this._prefBranch = Cc["@mozilla.org/preferences-service;1"].
                       getService(Ci.nsIPrefService).getBranch("browser.formfill.");
    this._prefBranch.QueryInterface(Ci.nsIPrefBranch2);
    this._prefBranch.addObserver("", this.observer, false);
    this.observer._self = this;

    this._debug   = this._prefBranch.getBoolPref("debug");
    this._enabled = this._prefBranch.getBoolPref("enable");
    this._agedWeight = this._prefBranch.getIntPref("agedWeight");
    this._bucketSize = this._prefBranch.getIntPref("bucketSize");
    this._maxTimeGroupings = this._prefBranch.getIntPref("maxTimeGroupings");
    this._timeGroupingSize = this._prefBranch.getIntPref("timeGroupingSize") * 1000 * 1000;
    this._expireDays = this._getFormExpiryDays();

    this._dbStmts = [];

    this._observerService.addObserver(this.observer, "xpcom-shutdown", false);
},

问题似乎发生在这一行:

    this._debug   = this._prefBranch.getBoolPref("debug");

现在,我最好的猜测是FireFox读取其偏好的地方不存在偏好“debug”。

我对FireFox了解不多,在网上搜索并没有产生太多信息。

问题:FireFox在哪里存储/检索这些首选项?

我想如果我将“调试”首选项放入此位置,我应该消除错误。但是,我愿意接受其他建议/更多信息。

谢谢! --- ---丹

1 个答案:

答案 0 :(得分:-1)

好。我想到了。也许这会帮助别人。在nsFormAutoComplete.js中,有一个首选项列表。

prefs.js文件是密钥,它位于C:\ Documents and Settings \\ application data \ firefox \ profiles \\ prefs.js。

您不想直接编辑此文件。而是在FireFox的地址栏中键入about:config并以这种方式添加首选项。偏好如下:

browser.formfill。并输入。

所以对于调试版,它是browswer.formfill.debug作为bool。我把它设置为假。之后,它在下一个偏好是.agedWeight时失败了。

添加nsFormAutoComplete.js中的所有首选项后,我发现错误消失了。

相关问题