2012-09-18 36 views

回答

1

你可以用bash命令找出默認的用戶瀏覽器,然後檢查包含chromechromium子串。像這樣的東西。

1.9.3p194 :001 > mimelist = `cat ~/.local/share/applications/mimeapps.list | grep text/html` 
=> "text/html=google-chrome.desktop\n" 
1.9.3p194 :004 > mimelist.include?('chrome') 
=> true 
1.9.3p194 :005 > mimelist.include?('chromium') 
=> false