注册XPCOM组件到Gecko17

就像在“Creating_XPCOM_Components“描述的那样,我们可以通过三种方式把XPCOM组件注册到XPCOM系统。 但是在Gecko 17开始,有了些变化(例如,regxpcom找不到了),我们需要编辑一个文件“chrome.manifests”,来显示告诉XPCOM系统要注册那个组件。 这个文件应该放在应用的根目录(与application.ini一个目录),下面是一个例子:

#chrome.manifests
content test    chrome/content/
locale  test    en-US   chrome/locale/en-US/
skin    test    classic/1.0 chrome/skin/
manifest components/samplecomp.manifest

正如上面的片段所示,第5行(manifest开始的行)表示要在XPCOM系统里注册组件的位置。 详细的细节参见Chrome registration“。

Look above snippet text, the highlight text shows the components that you want to register. Detail about chrome.manifests,see.

The directory list:

test
 + chrome
 + components  // 下面放置了组件及组件的manifest,和xpt文件
 + default
 + xulrunner
 - application.ini
 - chrome.manifests
 - xulrunner-stub.exe

发布了52 篇原创文章 · 获赞 7 · 访问量 15万+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章