我試圖在Firefox擴展中保存少量持久數據。試圖使用nsIPrefBranch在Firefox擴展中存儲數據給NS_ERROR_UNEXPECTED
所以,我試圖用nsIPrefBranch
這樣的:
var db = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
if(db.getCharPref('epoch')){ ///do something.. }
,但它似乎沒有工作,我得到這個錯誤:
"Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsIPrefBranch.getCharPref]"
有人可以告訴我做錯了什麼?
感謝鮑勃:)(拼寫更正..) – jsbuster 2012-02-02 21:58:08