Firefox webdriver 始终打开首次运行页面

2023-12-20

如何为 FF 彻底禁用此“首次运行”页面?

创建 FF 驱动程序后,它会打开选​​项卡 -https://www.mozilla.org/en-US/firefox/42.0/firstrun/learnmore/ https://www.mozilla.org/en-US/firefox/42.0/firstrun/learnmore/以及带有目标页面的附加选项卡。


要关闭这个烦人的起始页:

在 C# 和 Selenium 2.48 中我找到了以下解决方案:

FirefoxProfile prof = new FirefoxProfile();
prof.SetPreference("browser.startup.homepage_override.mstone", "ignore");
prof.SetPreference("startup.homepage_welcome_url.additional",  "about:blank");
Driver = new FirefoxDriver(prof);

......它永远不会再打扰你。

注意:单独使用其中一项设置也可以工作。我将它们一起使用以使其防弹。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Firefox webdriver 始终打开首次运行页面 的相关文章

随机推荐