我按照此处的说明进行操作,安装后我打开控制台模式进行调试,但日志卡在那里而没有任何响应:控制台只显示如下内容,没有更多输出:
*** LOG addons.updates: Requesting https://www.extension.host.com/update.rdf
我install.rdf
的是:
<?xml version="1.0"?>
<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>webmailchecker@mozilla.doslash.org</em:id>
<em:name>WebMail Checker for Firefox</em:name>
<em:version>1.0</em:version>
<em:description>WebMail Checker</em:description>
<em:updateURL>https://www.extension.host.com/update.rdf</em:updateURL>
<!-- Firefox -->
<em:targetApplication>
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
<em:minVersion>3.6</em:minVersion>
<em:maxVersion>23.*</em:maxVersion>
</Description>
</em:targetApplication>
</Description>
</RDF>
并且update.rdf
是:
<?xml version="1.0" encoding="UTF-8"?>
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<RDF:Description about="urn:mozilla:extension:webmailchecker@mozilla.doslash.org">
<em:updates>
<RDF:Seq>
<!-- Each li is a different version of the same add-on -->
<RDF:li>
<RDF:Description>
<em:version>1.0</em:version>
<em:targetApplication>
<RDF:Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
<em:minVersion>1.5</em:minVersion>
<em:maxVersion>23.*</em:maxVersion>
<em:updateLink>https://www.extension.host.com/firefox.xpi</em:updateLink>
</RDF:Description>
</em:targetApplication>
</RDF:Description>
</RDF:li>
<RDF:li>
<RDF:Description>
<em:version>2.0</em:version>
<em:targetApplication>
<RDF:Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
<em:minVersion>1.5</em:minVersion>
<em:maxVersion>23.*</em:maxVersion>
<em:updateLink>https://www.extension.host.com/firefox_2.0.xpi</em:updateLink>
</RDF:Description>
</em:targetApplication>
</RDF:Description>
</RDF:li>
</RDF:Seq>
</em:updates>
</RDF:Description>
</RDF:RDF>
在服务器端,update.rdf 和 xpi 文件都返回为javax.ws.rs.core.Response
,我已将 mimemapping 配置web.xml
如下:
<mime-mapping>
<extension>xpi</extension>
<mime-type>application/x-xpinstall</mime-type>
</mime-mapping>
<mime-mapping>
<extension>rdf</extension>
<mime-type>text/xml</mime-type>
</mime-mapping>
我错过了什么?自动更新不起作用。