註冊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萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章