我的问题是关于修改默认配置文件设置以允许/拒绝我的网络应用程序访问麦克风和摄像头。这是代码-似乎被忽略了。
#!/usr/bin/ruby
require 'watir-webdriver'
profile = Selenium::WebDriver::Chrome::Profile.new
profile['content_settings.pattern_pairs.*,*.media-stream-mic'] = 1
# if I put mysever.com into here (first asterix), the parsing must fail
# as the '.' is used as delimiter by profile.rb - so *,* should work
browser = Watir::Browser.new :chrome, :profile => profile
browser.goto "http://webaudiodemos.appspot.com/input/index.html"
# here a get media event is fired and the browser should proceed without(!)
# asking the user for permission - but the browser is always asking and
# this element is not accessible for Watir (is it?).
我查看了仅进行解析的 profile.rb - 这也存在某种问题(请参阅内联评论)。
我也搜索了网络,但找不到任何东西。
霍尔格