自己动手解决附加组件与Firefox无法兼容的问题

广告点击跟踪 Add comments

喜欢Firefox的朋友,特别是使用Firefox最新版的Ffer,在安装Firefox附加组件时经常会遇类似这样的提示:(以moneyquake-1.1.1为例进行说明)

MoneyQuake 1.1.1 无法被安装,因为它与 Firefox 3.0b5 无法兼容。

出现此提示是因为每个版本的Firefox的API都有相应的调整,所以当这些附加组件的作者在制作这些附件组件的安装包.xpi时,限制了它的使用范围,我们可以使用Winrar或者Winzip打开下载到的moneyquake-1.1.1-fx.xpi文件,然后查看其中的install.rdf文件:

<em:targetApplication>
    <!– Firefox –>
    <Description>
        <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
        <em:minVersion>2.0</em:minVersion>
        <em:maxVersion>3.0a1</em:maxVersion>
    </Description>
</em:targetApplication>

其中的em:minVersion和em:maxVersion即是限制此组件可以正常安装的Firefox的版本号的区间。

em:minVersion 为最低可以安装这个插件的版本,maxVersion反之。

但是当我们在使用Beta版本时,需要的组件不一定会及时更新,安装的时候就会提示与 Firefox **无法兼容。

知道了原理,要突破它也就不难了,用Winrar或者Winzip打开moneyquake-1.1.1-fx.xpi文件把install.rdf文件里的maxVersion改成适合的版本号,如:

<em:targetApplication>
    <!– Firefox –>
    <Description>
        <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
        <em:minVersion>2.0</em:minVersion>
        <em:maxVersion>3.0</em:maxVersion>
    </Description>
</em:targetApplication>

然后把install.raf覆盖moneyquake-1.1.1-fx.xpi里的原有文件。就可以把moneyquake-1.1.1-fx.xpi拖动到Firefox窗口正常安装了。

但是这个方法不一定对所有的附加组件有效,特别是对于还未支持Firefox3的附加组件,因为从Firefox2到Firefox3有很大的变化,更改install.rdf后即使能够正常安装但不一定可以使用。

参考:firefox扩展插件制作方法

下载:Firefox Add-ons: MoneyQuake

One Response to “自己动手解决附加组件与Firefox无法兼容的问题”

  1. 解决插件与Firefox无法兼容的问题 | Firefox.hk Says:

    [...] 解决插件与Firefox无法兼容的问题 [...]

Leave a Reply

 
WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS 登录