我正在尝试根据来自https://developer.mozilla.org/en/Localizing_extension_descriptions的信息(Gecko 1.9之前的本地化)为本地化名称构建Firefox扩展,但它不起作用。浏览器的Javascript控制台中的错误是:
Błąd: [Exception... "Component returned failure code: 0x80004003 (NS_ERROR_INVALID_POINTER) [nsIRDFService.GetLiteral]" nsresult: "0x80004003 (NS_ERROR_INVALID_POINTER)" location: "JS frame :: file:///C:/Program%20Files/Mozilla%20Firefox%201.5/components/nsExtensionManager.js :: EM_L :: line 225" data: no] Plik źródłowy: file:///C:/Program%20Files/Mozilla%20Firefox%201.5/components/nsExtensionManager.js Wiersz: 225
我的扩展文件层次结构是:
gemgecko.xpi: /install.rdf /components/gemgecko.dll /defaults/preferences/prefs.js /chrome.manifest /chrome/locale/pl/install.properties /chrome/locale/en/install.properties
/defaults/preferences/prefs.js:
pref("extensions.gemgecko@gemius.pl.name", "chrome://gemgecko/locale/en/install.properties");
/chrome/locale/en/install.properties:
extensions.gemgecko@gemius.pl.name=gemiusAudience study
/chrome/locale/pl/install.properties:
extensions.gemgecko@gemius.pl.name=Badanie Megapanel PBI/Gemius
有人可以帮我在我的扩展程序中找到错误吗?
修改
我正在添加安装清单......
/install.rdf:
<?xml version="1.0" encoding="UTF-8"?>
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<Description about="urn:mozilla:install-manifest">
<em:id>gemgecko@gemius.pl</em:id>
<em:version>2.01</em:version>
<em:name>nazwa</em:name>
<em:creator>tworca</em:creator>
<em:description>opis</em:description>
<em:homepageURL>http://www.test.pl</em:homepageURL>
<em:targetApplication>
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> <!-- firefox -->
<em:minVersion>1.5.0</em:minVersion>
<em:maxVersion>*</em:maxVersion>
</Description>
</em:targetApplication>
</Description>
</RDF>
我在Firefox 1.5和3.6上测试过它。在3.6上似乎一切正常,但在1.5上没有 - 扩展管理器显示来自install.rdf
的扩展名,而不是chrome://gemgecko/locale/install.properties
...
答案 0 :(得分:1)
chrome://gemgecko/locale/en/install.properties
看起来对我不对,/ en /不是chrome:URL的一部分,在转换chrome:URL时会替换它。
编辑:
我在chrome.manifest中看不到任何chrome registration个条目。他们应该看起来像这样:
locale gemgecko pl chrome/locale/pl
locale gemgecko en chrome/locale/en