是否有一个Chrome开关来禁止“外部协议请求"? [英] Is there a chrome switch to suppress 'external protocol request'?
问题描述
是否有一个Chrome开关来禁止外部协议请求"?
Is there a chrome switch to suppress 'external protocol request' ?
我正在使用selenium-ruby-watir webdriver自动化应用程序.
I am automating an application using selenium - ruby - watir webdriver.
我在网上搜索了绕过此窗口和对话的解决方案: http://productforums.google.com/forum/#!topic/chrome/K22hXwRy6zQ 概述了我们如何手动执行此操作.但是对于Selenium-Chrome-Ruby,我需要通过设置chrome开关(chorme开关列表:=
I searched over net for solutions to bypass this window and conversation: http://productforums.google.com/forum/#!topic/chrome/K22hXwRy6zQ gives an overview on how we can do that manually. But for Selenium-Chrome-Ruby, I need to do this by probably setting a chrome switch (List of chorme switch:= http://src.chromium.org/svn/trunk/src/chrome/common/chrome_switches.cc). and that's a huge list. I need help with figuring out which switch would probably help me bypass external protocol request window or if there is any workaround for this through automation?
推荐答案
http ://productforums.google.com/forum/#!topic/chrome/K22hXwRy6zQ 已经给出了答案,我们应该做的是更改watir浏览器的prefs
http://productforums.google.com/forum/#!topic/chrome/K22hXwRy6zQ has given the answer already, what we should do is change the prefs
for watir browser
代码如下:
prefs = {
protocol_handler: {
excluded_schemes: {
your_scheme: true,
}
},
}
Watir::Browser.new :chrome, prefs: prefs
感谢您的研究@simminni
Thanks for your research @simminni
这篇关于是否有一个Chrome开关来禁止“外部协议请求"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!