Here is a snippet to prevent warnings from appearing in the console: https://github.com/thoughtbot/capybara-webkit/issues/157 .
Capybara::Webkit.configure do |config| config.block_unknown_urls # <--- this configuration would be lost if you didn't use .merge below end class WebkitStderrWithQtPluginMessagesSuppressed IGNOREABLE = Regexp.new( [ 'CoreText performance', 'userSpaceScaleFactor', 'Internet Plug-Ins', 'is implemented in bo' ].join('|') ) def write(message) if message =~ IGNOREABLE 0 else puts(message) 1 end end end Capybara.register_driver :webkit_with_qt_plugin_messages_suppressed do |app| Capybara::Webkit::Driver.new( app, Capybara::Webkit::Configuration.to_hash.merge( # <------ maintain configuration set in Capybara::Webkit.configure block stderr: WebkitStderrWithQtPluginMessagesSuppressed.new ) ) end Capybara.javascript_driver = :webkit_with_qt_plugin_messages_suppressed
While this works to hide messages, I believe that the correct way to fix them is to prevent plugins from ever downloading from loading. But I did not understand how to do this with Capybara and webkit.
source share