谢谢大家的回答。
我终于找到了解决方案。为了从Chrome 69开始以编程方式启用闪光灯,我们必须做两件事:
- 禁用临时Flash权限(以启用Flash网站允许的列表)和
- 将所有站点添加到该列表。
请参阅以下有关Java的代码:
ChromeOptions options = new ChromeOptions();// disable ephemeral flash permissions flagoptions.addArguments("--disable-features=EnableEphemeralFlashPermission");Map<String, Object> prefs = new HashMap<>();// Enable flash for all sites for Chrome 69prefs.put("profile.content_settings.exceptions.plugins.*,*.setting", 1);options.setExperimentalOption("prefs", prefs);nestedDriver = new ChromeDriver(options);


