问题
Is there a chrome switch to suppress 'external protocol request' ?
I am automating an application using selenium - ruby - watir webdriver.
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?
回答1:
http://productforums.google.com/forum/#!topic/chrome/K22hXwRy6zQ has given the answer already, what we should do is change the prefs
for watir browser
codes as below:
prefs = {
protocol_handler: {
excluded_schemes: {
your_scheme: true,
}
},
}
Watir::Browser.new :chrome, prefs: prefs
Thanks for your research @simminni
来源:https://stackoverflow.com/questions/19034715/is-there-a-chrome-switch-to-suppress-external-protocol-request