Firefox - 如何列出已安装的扩展名并在列表中标识它们? [英] Firefox - how do I list installed extensions and identify them in a list?
问题描述
-
是否有一个API可以生成Firefox中所有已安装扩展的列表?
如果是这样,我将如何唯一标识一个扩展?我需要的是有一个ID持续通过不同版本的扩展名,理想情况下通过重命名(所以名称可能不是最好的选择)。它是GUID吗?
谢谢!
解决方案注意:这个答案已经过时了。 nsIExtensionManager被
AddonManager
和FUEL已被弃用。
您可以从nsIExtensionManager获取项目列表。是的,扩展名是唯一的ID(
nsIUpdateItem :: id
),
第二个想法是FUEL真的很有用。在$ {
Application.extensions.all.forEach(function(item){alert(item.id) })
Two related questions:
Is there an API to produce a list of all the installed extensions in Firefox?
If so, how would I uniquely identify an extension? What I need is to have an ID that persists through different versions of an extension and ideally through a renaming (so name may not be the best option). Is it GUID?
Thanks!
解决方案Note: this answer is outdated. nsIExtensionManager was replaced by
AddonManager
, and FUEL is deprecated.You can get the list of items from nsIExtensionManager. Yes there is a unique ID for extensions (
nsIUpdateItem::id
), as specified in the install manifest.On a second thought, this is where FUEL is really useful. Try this in the Error Console:
Application.extensions.all.forEach(function(item) { alert(item.id) })
这篇关于Firefox - 如何列出已安装的扩展名并在列表中标识它们?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!