gpt4 book ai didi

java - 如何使用 FirefoxProfile 在 FireFox Selenium webdriver 中启用 Adob​​e Flash

转载 作者:搜寻专家 更新时间:2023-10-31 20:00:09 26 4
gpt4 key购买 nike

我需要一种无需用户交互即可在 Firefox Selenium 网络驱动程序中启用 Flash 的自动化方法。

我试过:

FirefoxProfile profile = new FirefoxProfile();
//As 0 is to disable, I used 1. I don"t know what to use.
profile.setPreference("plugin.state.flash", 1);
WebDriver driver = new FirefoxDriver(profile);

但这仍然需要我点击“允许”。

This is shown all the time, even with the code above

最佳答案

这对我不起作用:profile.setPreference("dom.ipc.plugins.enabled.libflashplayer.so","true");

相反,我使用了:profile.setPreference("plugin.state.flash", 2);

我假设“2”也会激活插件。

关于java - 如何使用 FirefoxProfile 在 FireFox Selenium webdriver 中启用 Adob​​e Flash,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43376707/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com