Chrome C# selenium --whitelisted-extenson-id在没有转储的情况下导致崩溃

kknvjkwl  于 2023-04-27  发布在  Go
关注(0)|答案(1)|浏览(175)

我使用chrome with selenium来测试我的扩展:

ChromeOptions chromeOptions;
IWebDriver tempDriver = null;

string extensionId = "123";

chromeOptions = new ChromeOptions();
chromeOptions.AddArgument(@"--load-extension=path/to/extension");
chromeOptions.AddArgument(@"--whitelisted-extension-id=" + extensionId);

ChromeDriverService service = ChromeDriverService.CreateDefaultService();
tempDriver = new ChromeDriver(service, chromeOptions);

当我正常启动chrome时,它工作正常。然而,每当我添加参数时:
--whitelisted-extension-id=
它崩溃/关闭,没有任何错误日志
添加崩溃文件夹没有帮助:
--crash-dumps-dir=C:\\chrome-crash
我在selenium中使用这个参数,在使用--load-extension添加扩展后将其加入白名单,以便我可以使用它。
我目前使用的是Chrome版本112.0.5615.50(Official Build)(64-bit)

zysjyyx4

zysjyyx41#

我在使用Selenium驱动Chrome并使用--whitelisted-extension-id时遇到了同样的问题。但是这个问题可以很容易地重现,只需从版本112的shell中调用带有该标志的Chrome。因此,我认为这是一个bug,我刚刚在Chromium bug跟踪器中报告了:
https://bugs.chromium.org/p/chromium/issues/detail?id=1433472
更新:他们通过以下评论关闭了上述问题:
报告的错误是不再支持参数。您需要使用“--allowlisted-extension-id”

相关问题