尝试将 FoxyProxy 扩展添加到 Firefox 驱动程序时,如下所示:
from selenium.webdriver import FirefoxProfile, DesiredCapabilities
from selenium import webdriver
profile =FirefoxProfile()
firefox_capabilities = DesiredCapabilities.FIREFOX
firefox_capabilities['marionette'] = False
profile.add_extension(extension='res/foxyproxy@eric.h.jung.xpi')
profile.set_preference("extensions.logging.enabled", True)
driver = webdriver.Firefox(profile,capabilities=firefox_capabilities)
一切似乎都很好,但是当窗口打开时,我看到 FoxyProxy 没有安装,浏览器控制台也会给出以下消息:
1566128038983 addons.xpi-utils DEBUG New add-on foxyproxy@eric.h.jung installed in app-profile
Blocklist::loadBlocklist: blocklist is disabled
1566128039076 addons.xpi-utils WARN Add-on foxyproxy@eric.h.jung is not correctly signed. 2
1566128039076 addons.xpi-utils WARN addMetadata: Add-on foxyproxy@eric.h.jung is invalid: Error: Extension foxyproxy@eric.h.jung is not correctly signed(resource://gre/modules/addons/XPIDatabase.jsm:2452:17) JS Stack trace: addMetadata@XPIDatabase.jsm:2452:17
processFileChanges@XPIDatabase.jsm:2809:26
checkForChanges@XPIProvider.jsm:2728:55
startup@XPIProvider.jsm:2265:12
callProvider@AddonManager.jsm:193:31
_startProvider@AddonManager.jsm:569:5
startup@AddonManager.jsm:725:14
startup@AddonManager.jsm:2797:26
observe@addonManager.js:65:29
这意味着扩展名未正确签名。该xpi
文件是直接从我的普通配置文件扩展文件夹中购买的,所以我不明白为什么会出现此警告?它实际上是安装失败的根源吗?