Is there a chrome switch to suppress 'external protocol request'?

a 夏天 提交于 2019-12-06 01:41:45

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!