0
我試圖獲取當前打開的配置文件列表。下面的代碼列出了alll配置文件,不管是否打開:所有當前打開的配置文件列表
var tps = Cc['@mozilla.org/toolkit/profile-service;1'].createInstance(Ci.nsIToolkitProfileService); //toolkitProfileService
var profileList = tps.profiles;
while (profileList.hasMoreElements()) {
var profile = profileList.getNext().QueryInterface(Ci.nsIToolkitProfile);
console.info(profile)
}
好主意,不過是這個鎖定進程同步嗎?還是異步?還是它同步,但速度超快? – Noitidart
我用相對片段更新了答案。這是同步操作,但我不明白爲什麼它會很昂貴。 – paa
非常感謝非常感謝的人! :)如果我們不測試e是ns_error_file_access_denied,我們將如何做到這一點?我們會不會'e.name =='ns_error_file_access_denied''? – Noitidart