1

我有一個使用最新的Firefox ESR(當前爲24.6.0)成功安裝的FireFox附加組件,但在嘗試安裝最新的Tor瀏覽器組件時會返回此錯誤。TorBrowser的附加組件兼容性

我的測試WebDriver無法安裝,因爲它與TorBrowser 24.6.0不兼容。

Tor Browser Version

爲什麼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>[email protected]</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> 

我試圖讓硒的webdriver與使用手動的.xpiTor Browser Bundle工作。

回答

2

這裏的問題實際上是你的targetPlatforms。 TorBrowser的編譯方式不同,以允許它們執行確定性構建。特別是Tor瀏覽器是由一些mingw-gcc編譯的,而官方的Firefox則是由MSVC編譯器編譯的。

記住targetPlatform是:

一個字符串,指定了一個平臺,在附加支撐。它包含單獨的OS_TARGET的值或與TARGET_XPCOM_ABI組合,由下劃線(_)分隔。

在TorBrowser,OS_TARGET仍然是WINNT,但XPCOMABIx86-gcc3 apparantly。因此您的targetPlatformWINNT_x86-msvc與預期的WINNT_x86-gcc3不符。

BTW:您可以從正在運行的瀏覽器實例獲取OS_TARGETXPCOMABI,例如,由about:newtab選項卡上打開Web控制檯並執行:

Services.appinfo.OS 
// and 
Services.appinfo.XPCOMABI 

,所以業務的第一順序將嘗試添加WINNT_x86-gcc3targetPlatform秒。

正如你顯然有二進制組件這可能會或可能不會工作......不知道如果MSVC編譯「膠水」是與gcc編譯的兼容,所以你的二進制組件可能仍然無法加載。 然後,您可能必須使用適當的編譯器(mingw-gcc,請參閱TOR確定性構建文檔)重新編譯您的組件以適應不同的目標,或者,從長遠來看,這可能會更好,切換到js如果可能的話,使用常規的C API/ABI庫。

+0

這工作得到它安裝。我添加了'WINNT_x86-gcc3'作爲目標平臺,並複製了'/ platforms/WINNT_x86-msvc'下的文件夾。無法測試文件夾中的「.dll」是否仍按預期工作。 – arserbin3