简体   繁体   English

Watir:如何设置`chrome://settings/content/pdfDocuments`

[英]Watir: How to set `chrome://settings/content/pdfDocuments`

I am trying to set the options for Watir with chrome driver, but can no figure out how to set:我正在尝试使用 chrome 驱动程序设置 Watir 的选项,但不知道如何设置:

chrome://settings/content/pdfDocuments to true or false. chrome://settings/content/pdfDocuments为真或假。

What would the pref variable be to set this? pref 变量是什么来设置这个?

Watir::Browser.new:chrome, options: {prefs: prefs}

Are you looking for this?你在找这个吗? https://stackoverflow.com/a/42927095/4072371 https://stackoverflow.com/a/42927095/4072371

prefs = {"plugins.always_open_pdf_externally" => true}
Watir::Browser.new :chrome, options: {prefs: prefs}

Make sure you are using a String for the prefs key确保您使用字符串作为首选项键

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM