Disable Edge PDF Viewer in new tab

已查看 83 次
跳至第一个未读帖子

Rommel F

未读,
2022年9月20日 04:34:282022/9/20
收件人 Selenium Users
Hi,

I want to disable PDF opening in new tab and instead download the PDF while executing the selenium scripts.

For Chrome, I have the below chrome options and it works fine.
  •  chromeOptions.AddUserProfilePreference("plugins.always_open_pdf_externally", true);
  •  chromeOptions.AddUserProfilePreference("plugins.plugins_disabled", new[] { "Chrome PDF Viewer" });
  • chromeOptions.AddUserProfilePreference("profile.default_content_setting_values.automatic_downloads", 1);

On Edge, I tried below but it does not work.
  •  edgeOptions.AddUserProfilePreference("profile.default_content_setting_values.automatic_downloads", 1);
  •  edgeOptions.AddUserProfilePreference("plugins.always_open_pdf_externally", true);

Am I missing some steps?

Thanks,
Rommel
回复全部
回复作者
转发
0 个新帖子