现在的位置: 首页 > 综合 > 正文

注册XPCOM组件到Gecko17

2013年12月13日 ⁄ 综合 ⁄ 共 663字 ⁄ 字号 评论关闭

就像在“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

抱歉!评论已关闭.