注册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