我正在按照http://www.borngeek.com/firefox/automatic-firefox-extension-updates/的教程来使我的FF扩展可以自动更新给用户,但我坚持到最后一部分"Hosting an Update Manifest",因为我正在使用Tomcat服务,我不知道如何设置.htaccess(是.htaccess在配置服务器方面与WEB-INF目录类似的文件?)
到目前为止我做了什么,
创建密钥对:Public-Key和Private-Key
计算sha256:b3290c69a1 ......
创建update.rdf
<?xml version="1.0"?>
<r:RDF xmlns:r="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://www.mozilla.org/2004/em-rdf#">
<r:Description about="urn:mozilla:extension:myextension@mozilla.myextension.org">
<updates>
<r:Seq>
<r:li>
<r:Description>
<version>1.0.1</version>
<targetApplication>
<r:Description>
<id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</id>
<minVersion>3.5</minVersion>
<maxVersion>5.0.*</maxVersion>
<updateLink>http://localhost:8080/myextension/pluginupdate/myextension.xpi</updateLink>
<updateHash>
sha256:b3290c69a1...
</updateHash>
</r:Description>
</targetApplication>
</r:Description>
</r:li>
</r:Seq>
</updates>
</r:Description>
</r:RDF>
使用密钥签署update.rdf
在singinupdate目录下放置singed update.rdf和myextension.xpi,其中pluginupdate与WEB-INF位于同一级别 .
我的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>myextension@mozilla.myextension.org</em:id>
<em:name>My Test extension</em:name>
<em:version>1.0</em:version>
<em:description>Test Mozilla Extension.</em:description>
<em:creator>TEST Group</em:creator>
<!-- optional items -->
<em:contributor>Me</em:contributor>
<em:homepageURL>http://?????????/</em:homepageURL>
<em:updateKey>
MIGfMA0G.....
</em:updateKey>
<em:updateURL>http://localhost:8080/myextension/pluginupdate/update.rdf</em:updateURL>
<!-- Firefox -->
<em:targetApplication>
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
<em:minVersion>3.5</em:minVersion>
<em:maxVersion>5.0.*</em:maxVersion>
</Description>
</em:targetApplication>
</Description>
</RDF>
当我重启FF浏览器时,没有任何反应 . 当我使用带有选项-console的命令行启动FF浏览器时
*** LOG addons.xpi: startup
*** LOG addons.xpi: checkForChanges
*** LOG addons.xpi: No changes found
*** LOG addons.xpi: Opening database
那么,我如何托管和配置Tomcat来托管更新清单?谢谢
Update
嗨弗拉迪米尔,
在web.xml中的MIME类型中定义之后,还会使用-console选项提供更多信息 .
我删除了扩展并重新安装,日志是
*** LOG addons.xpi: startup
*** LOG addons.xpi: checkForChanges
*** LOG addons.xpi: No changes found
*** LOG addons.xpi: Opening database
*** LOG addons.repository: Requesting https://services.addons.mozilla.org/en-GB/firefox/api/1.5/search/guid:myextension%40mozilla.myextension.org?src=firefox&appOS=Linux&appVersion=5.0&tMain=23&tFirstPaint=1641&tSessionRestored=1042
*** LOG addons.xpi: Starting install of file:///home/me/browserplugindev/firefox/test/myextension.xpi
*** LOG addons.xpi: Addon myextension@mozilla.myextension.org will be installed as a packed xpi
*** LOG addons.xpi: Install of file:///home/me/browserplugindev/firefox/test/myextension.xpi completed.
NOTE: child process received `Goodbye', closing down
*** LOG addons.xpi: shutdown
*** LOG addons.xpi: startup
*** LOG addons.xpi: checkForChanges
*** LOG addons.xpi: Found updated manifest for myextension@mozilla.myextension.org in app-profile
*** LOG addons.xpi: Processing install of myextension@mozilla.myextension.org in app-profile
*** LOG addons.xpi: Opening database
*** LOG addons.xpi: New add-on myextension@mozilla.myextension.org installed in app-profile
*** LOG addons.xpi: Updating database with changes to installed add-ons
*** LOG addons.xpi: Updating add-on states
*** LOG addons.xpi: Writing add-ons list
弗罗姆线
LOG addons.repository: Requesting https://services.addons.mozilla.org/en-GB/firefox/api/1.5/search/guid:myextension%40mozilla.myextension.org?src=firefox&appOS=Linux&appVersion=5.0&tMain=23&tFirstPaint=1641&tSessionRestored=1042
我们可以看到Update Manager(?)正在https://services.addons.mozilla.org/en-GB/firefox/api/1.5/search/guid:myextension%40mozilla.myextension.org?src向存储库发出请求=火狐&appOS = Linux和appVersion = 5.0&tMain = 23&tFirstPaint = 1641&tSessionRestored = 1042
此外,启动后
*** LOG addons.xpi: Found updated manifest for myextension@mozilla.myextension.org in app-profile
*** LOG addons.xpi: Processing install of myextension@mozilla.myextension.org in app-profile
这是否意味着找到了更新 . 但我没有看到浏览器上的通知告诉我“有一个新版本的myextension,更新?” .
我错过了什么吗?
1 回答
.htaccess文件的要点只是确保服务器知道MIME类型 . 您似乎可以通过更改conf / web.xml文件为Tomcat执行此操作:
我查看了你的update.rdf和install.rdf文件,我没有看到任何明显的问题 - 它应该工作 . 您可能希望转到
about:config
并启用extensions.logging.enabled
首选项,但这将确保将其他信息发送到错误控制台(按Ctrl-Shift-J打开或在命令行上使用-jsconsole
) .