Firefox TorBrowser中的附加组件兼容性

Firefox TorBrowser中的附加组件兼容性,firefox,selenium-webdriver,firefox-addon,xpi,tor-browser-bundle,Firefox,Selenium Webdriver,Firefox Addon,Xpi,Tor Browser Bundle,我有一个FireFox插件,它使用最新的FireFox ESR(当前为24.6.0)成功安装,但在尝试安装最新的Tor浏览器包时返回此错误 无法安装我的测试WebDriver,因为它与TorBrowser 24.6.0不兼容 为什么Tor浏览器说这是不兼容的,而Firefox 24.6.0却这么说?如何修改我的.xpi使其工作? 这是我的install.rdf: <?xml version="1.0"?> <RDF xmlns="http://www.w3.org/1999/

我有一个FireFox插件,它使用最新的FireFox ESR(当前为24.6.0)成功安装,但在尝试安装最新的Tor浏览器包时返回此错误

无法安装我的测试WebDriver,因为它与TorBrowser 24.6.0不兼容

为什么Tor浏览器说这是不兼容的,而Firefox 24.6.0却这么说?如何修改我的.xpi使其工作?

这是我的
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>test@example.com</em:id>
        <em:version>2.42.0</em:version>
        <em:name>My Test WebDriver</em:name>
        <em:description>WebDriver implementation for Firefox</em:description>
        <em:creator>Simon Stewart</em:creator>
        <em:unpack>true</em:unpack>

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

        <!-- Platforms where we're not compiling the native events -->
        <em:targetPlatform>Darwin</em:targetPlatform>
        <em:targetPlatform>SunOS</em:targetPlatform>
        <em:targetPlatform>FreeBSD</em:targetPlatform>

        <!-- Platforms where we are -->
        <em:targetPlatform>WINNT_x86-msvc</em:targetPlatform>
        <em:targetPlatform>Linux</em:targetPlatform>
    </Description>

</RDF>

test@example.com
2.42.0
我的测试网络驱动程序
Firefox的WebDriver实现
西蒙·斯图尔特
真的
{ec8030f7-c20a-464f-9b0e-13a3a9e97384}
17
10000
达尔文
苏诺斯
FreeBSD
WINNT_x86-msvc
Linux

我正试图让Selenium WebDriver使用manual.xpi来工作。

这里的问题实际上是您的
目标平台。TorBrowser以不同的方式编译,以允许它们执行确定性构建。特别是Tor浏览器是由一些mingw gcc编译的,而官方Firefox是由MSVC编译器编译的

记住这一点:

指定加载项支持的平台的字符串。它包含OS_TARGET单独的值或与TARGET_XPCOM_ABI组合的值,用下划线(u)分隔

在TorBrowser中,
OS_TARGET
仍然是
WINNT
,但
XPCOMABI
显然是
x86-gcc3
。因此,您的
WINNT_x86-msvc
targetPlatform
与预期的
WINNT_x86-gcc3
不匹配

顺便说一句:您可以从正在运行的浏览器实例中获取
OS_TARGET
XPCOMABI
,例如,在
about:newtab
选项卡上打开web控制台并执行: 

因此,第一个任务是尝试将
WINNT_x86-gcc3
添加到您的
targetPlatform
s中

因为你显然有二进制组件,这可能会也可能不会起作用。。。不确定MSVC编译的“glue”是否与gcc编译的兼容,因此二进制组件可能仍然无法加载。
然后,您可能需要使用适当的编译器(mingw gcc something;请参阅TOR deterministic build docs)为不同的目标重新编译组件,或者,从长远来看,这可能会更好,如果可能的话,可以切换到js ctypes和常规的C API/ABI库。

这样可以安装它。我添加了
WINNT_x86-gcc3
作为目标平台,并复制了
/platforms/WINNT_x86-msvc
下的文件夹。无法测试文件夹中的
.dll
是否仍能正常工作。
Services.appinfo.OS
// and
Services.appinfo.XPCOMABI