2015-09-07 20 views
5

Bất kỳ lời khuyên nào về việc tắt tiếng cảnh báo capybara-webkit này?Tắt tiếng cảnh báo capybara-webkit không cần thiết

2015-09-06 14: 15: 38,455 webkit_server [3700: 6.222.738] Lỗi tải /Users/justin/Library/Internet Plug-Ins/Web Google Earth Plug-in.plugin/Contents/MacOS /libnpgeplugin.dylib: dlopen (/ Người dùng/justin/Library/Internet Plug-Ins/Google Earth Web Plug-in.plugin/Contents/MacOS/libnpgeplugin.dylib, 265): không tìm thấy hình ảnh phù hợp. Đã tìm thấy:/Users/justin/Library/Internet Plugin/Google Earth Web Plug-in.plugin/Contents/MacOS/libnpgeplugin.dylib: mach-o, nhưng sai plugin kiến ​​trúc, plugin NP_Initialize bắt đầu, NP_Initialize end plugin, NP_GetEntryPoints bắt đầu Private_Initialize plugin, NP_GetEntryPoints kết thúc 2015/09/06 14: 15: 38,463 webkit_server [3700: 6.222.738] Lỗi tải /Users/justin/Library/Application Support /Facebook/video/3.1.0.522/FacebookVideoCalling.webplugin/Contents/MacOS/FacebookVideoCalling: dlopen (/ Người dùng/justin/Library/Application Hỗ trợ/Facebook/video/3.1.0.522/FacebookVideoCalling.webplugin/Contents/MacOS/FacebookVideoCalling, 262): không có hình ảnh phù hợp ound. Đã tìm thấy: /Người dùng/justin/Library/Application Hỗ trợ/Facebook/video/3.1.0.522/FacebookVideoCalling.webplugin/Contents/MacOS/FacebookVideoCalling: mach-o, nhưng kiến ​​trúc sai 2015-09-06 14:15: 38,493 webkit_server [3700: 6.222.738] không thể tìm thấy thực thi cho CFBundle 0x7ffd14fcd260 (không nạp) 2015/09/06 14: 15: 38,495 webkit_server [3700: 6.222.738] Lỗi tải /Library/Internet plug-Ins/QuickTime Plugin .plugin/Contents/MacOS/QuickTime Plugin: dlopen (/ Thư viện/Internet Plug-Ins/QuickTime Plugin.plugin/Nội dung/MacOS/QuickTime Plugin, 265): không tìm thấy hình ảnh phù hợp . Đã tìm thấy:/Library/Internet Plug-Ins/QuickTime Plugin.plugin/Contents/MacOS/QuickTime Plugin: mach-o, nhưng sai kiến ​​trúc objc [3700]: Lớp AdobePDFProgressView được thực hiện trong cả/Library/Internet cắm -Ins/AdobePDFViewer.plugin/Nội dung/MacOS/AdobePDFViewer và /Thư viện/Internet Trình cắm/AdobePDFViewerNPAPI.plugin/Nội dung/MacOS/AdobePDFViewerNPAPI. Một trong hai thứ sẽ được sử dụng. Cái nào không xác định. objc [3700]: Lớp ObjCTimerObject được thực hiện trong cả hai/Library/Internet Plug-Ins/AdobePDFViewer.plugin/Contents/MacOS/AdobePDFViewer và /Library/Internet Plug-Ins/AdobePDFViewerNPAPI.plugin/Contents/MacOS/AdobePDFViewerNPAPI . Một trong hai thứ sẽ được sử dụng. Cái nào không xác định. objc [3700]: Lớp MacCocoaSocketServerHelperRtc được thực hiện trong cả hai/Library/Internet Plug-Ins/o1dbrowserplugin.plugin/Contents/MacOS/o1dbrowserplugin và /Library/Internet Plug-Ins/googletalkbrowserplugin.plugin/Contents/MacOS/googletalkbrowserplugin . Một trong hai thứ sẽ được sử dụng. Cái nào không xác định.

Trả lời

5

Đây là đoạn mã để ngăn cảnh báo hiển thị trong bảng điều khiển: 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 

Trong khi điều này có tác dụng ẩn thư, tôi cảm thấy đúng cách để khắc phục sự cố là ngăn tải các plugin không bao giờ được tải.Nhưng tôi đã không tìm ra cách để làm điều đó với Capybara và webkit.

Các vấn đề liên quan