GitHub Gitee

注册XPCOM组件到Gecko17

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

  1. #chrome.manifests  
  2. content test    chrome/content/  
  3. locale  test    en-US   chrome/locale/en-US/  
  4. skin    test    classic/1.0 chrome/skin/  
  5. 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:

    1. test  
    2.  + chrome  
    3.  + components  // 下面放置了组件及组件的manifest,和xpt文件  
    4.  + default  
    5.  + xulrunner  
    6.  - application.ini  
    7.  - chrome.manifests  
    8.  - xulrunner-stub.exe 
posted @ 2012-12-30 18:13  shudingbo  阅读(263)  评论(0编辑  收藏  举报
GitHub Gitee