简体   繁体   English

如何为Firefox +45.0.1正确重建.xpi文件?

[英]How to properlly rebuild a .xpi file for Firefox +45.0.1?

I would like to force the compatibility of FastDial for the new Firefox 4.5.0.1, and other extensions. 我想强制FastDial与新的Firefox 4.5.0.1和其他扩展兼容。

I did this in the past for a lot of addons, I know the procediment... the xpi is just a zip file, that when extracted their contents, you will find a file with name Install.rdf , containing this line: 过去我做了很多附加操作,我知道这样的程序... xpi只是一个zip文件,当提取其内容时,您会发现一个名为Install.rdf的文件,其中包含以下行:

<em:maxVersion>X.0</em:maxVersion>

Then the desired version is set, and recompress the Zip, and change the .zip extension to .xpi. 然后设置所需的版本,然后重新压缩Zip,并将.zip扩展名更改为.xpi。

However, that methodology is not working for Firefox 45.0.1 (x86). 但是,该方法不适用于Firefox 45.0.1(x86)。

This is what always happens when trying to install a rebuilt xpi using the known methodology: 这是尝试使用已知方法安装重建的xpi时总是发生的情况:

在此处输入图片说明

The Spanish error-message of the image above says: 上图的西班牙文错误讯息说:

This addon cannot be installed because seems damaged. 无法安装此插件,因为它似乎已损坏。

So... what changed in this damn Firefox 4.5.0.1 that does not accept our rebuilt addons?. 那么...在该死的Firefox 4.5.0.1中,什么不接受我们重建的插件而发生了什么变化?

UPDATE UPDATE

I noted that the problem is with the Install.rdf file, If I do not change the <em:maxVersion>...</em:maxVersion> , then I can recompress properlly the package and it is recognized by this new Firefox. 我注意到问题出在Install.rdf文件上,如果我不更改<em:maxVersion>...</em:maxVersion> ,那么我可以适当地重新压缩该软件包,并且此新Firefox可以识别它。

Then how I need to edit the Install.rdf file to avoid "corrupting" the xpi package for this new Firefox?. 那么,我该如何编辑Install.rdf文件,以避免“损坏”此新Firefox的xpi软件包?

I tried using Wordpard to edit the rdf file, I also tried Sublime Text, saving the file with and without BOM (UTF-8), and for re-compressing the package I used WinRar (I always used WinRar to do it), saving it as Zip, not RAR, of course. 我尝试使用Wordpard编辑rdf文件,还尝试了Sublime Text,使用和不使用BOM(UTF-8)保存该文件,并使用WinRar重新压缩程序包(我一直使用WinRar来做),保存当然是Zip,而不是RAR。

All extensions distributed by Mozilla for Firefox are signed by Mozilla . Mozilla为Firefox分发的所有扩展都由Mozilla 签名 The files containing the signatures are in the META-INF directory within the extension's top level directory. 包含签名的文件位于扩展程序顶级目录内的META-INF目录中。 These signature files are what are used to verify that the extension has not been modified from what has been reviewed and distributed by Mozilla. 这些签名文件用于验证扩展名是否已被Mozilla审查和分发的内容修改。

To get past the error you are seeing, you will need to remove that directory and its contents. 为了克服您看到的错误,您将需要删除该目录及其内容。

You will then have an issue that the extension is not signed. 然后,您将遇到扩展名未签名的问题。 Firefox will then refuse to load it for that reason. Firefox将因此拒绝加载它。 The quick solution to that is to set xpinstall.signatures.required to false in about:config . 对此的快速解决方案是在about:config中将xpinstall.signatures.required设置为false However, that will only be effective in release and beta versions of Firefox until the next version update, or so. 但是,这仅在Firefox的发行版beta版中有效,直到下一个版本更新为止。 When exactly changing that option will no longer work is not clear. 确切地更改该选项将不再起作用时,尚不清楚。 Turning off the availability of that option in the release and beta versions of Firefox has been a moving target, but the change is coming very soon. 在Firefox的发行版和beta版中关闭该选项的可用性一直是一个移动的目标,但是更改即将到来。 The option should continue to work in the Developer Edition of Firefox. 该选项在Firefox 开发人员版中应该可以继续使用。

Beyond those options, you will need to have the new extension, which you created by making any changes, signed by Mozilla. 除了这些选项之外,您还需要具有由Mozilla签名的扩展名,该扩展名是通过进行任何更改而创建的。 You will have to treat it as a new extension (ie you will have to create a new ID for it). 您将不得不将其视为新的扩展名(即,必须为其创建新的ID)。 Some resources which will help in figuring extension signing out (it would be a different question) are: 一些有助于确定扩展签出的资源(这将是另一个问题):

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM