小编doc*_*rue的帖子

允许Chrome 69中的Flash内容通过chromedriver运行

有没有人知道如何在Chrome 69中启用Flash插件.我使用chromedriver 2.41和java selenium绑定.我试过了

prefs.put("profile.default_content_setting_values.plugins", 1);
prefs.put("profile.content_settings.plugin_whitelist.adobe-flash-player", 1);
prefs.put("profile.content_settings.exceptions.plugins.*,*.per_resource.adobe-flash-player", 1);
Run Code Online (Sandbox Code Playgroud)

但没有运气.我还尝试将chrome配置文件首选项与特定网站的不允许/允许的Flash进行比较,然后尝试使用:

            Map<String, Object> site = new HashMap<>();
            Map<String, Object> values = new HashMap<>();
            Map<String, Object> setting = new HashMap<>();
            setting.put("flashPreviouslyChanged", true);
            values.put("last_modified", "13180613213099316");
            values.put("setting", setting);
            site.put("http://my.site,*", values);
            prefs.put("profile.content_settings.exceptions.flash_data", site);
Run Code Online (Sandbox Code Playgroud)

但它不会起作用.

我也尝试使用指定的配置文件运行

options.addArguments("user-data-dir=" + profileDir);
Run Code Online (Sandbox Code Playgroud)

但由于此白名单设置在Chrome 69中变为"短暂",因此也无效.

有没有方法可以在支持闪存的Chrome中运行我的自动化?

selenium google-chrome webdriver selenium-chromedriver selenium-webdriver

6
推荐指数
1
解决办法
7434
查看次数