解决了问题,谢谢YaLee,下面是解决的过程
YeLee 写了:看一下google的.desktop文件,看是不是少了一个%U在argv[1]里面。

看了一下/usr/share/applications/google-chrome.desktop 文件下,108行有
Exec=/usr/bin/google-chrome-stable %U
此外在~/.local/share/applications/文件夹下有如下三个文件
一、
chrome-ohmmkhmmmpcnpikjeljgnaoabkaalbgc-Default.desktop ,内容如下
#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Terminal=false
Type=Application
Name=Chrome Apps & Extensions Developer Tool
Exec=/opt/google/chrome/google-chrome --profile-directory=Default --app-id=ohmmkhmmmpcnpikjeljgnaoabkaalbgc
Icon=chrome-ohmmkhmmmpcnpikjeljgnaoabkaalbgc-Default
StartupWMClass=crx_ohmmkhmmmpcnpikjeljgnaoabkaalbgc
二、
google-chrome.desktop ,内容如下
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Name=Google Chrome
Icon=google-chrome
Path=/home/dora/Downloads
Exec=/opt/google/chrome/chrome
StartupNotify=false
StartupWMClass=google-chrome
OnlyShowIn=Unity;
X-UnityGenerated=true
MimeType=x-scheme-handler/unknown;x-scheme-handler/about;x-scheme-handler/https;x-scheme-handler/http;text/html;
三、
mimeapps.list ,内容如下
代码: 全选
[Default Applications]
text/html=google-chrome.desktop
x-scheme-handler/http=google-chrome.desktop
x-scheme-handler/https=google-chrome.desktop
x-scheme-handler/about=google-chrome.desktop
x-scheme-handler/unknown=google-chrome.desktop
查了一下,%U的意思
在
http://unix.stackexchange.com/questions ... um-desktop找到解释
It indicates that chromium may be passed a list of URLs on its command line. See the Exec key of the Desktop Entry Specification for a description of the available codes and what they mean.
所以尝试在~/.local/share/applications/google-chrome.desktop 中加上%U ,如下:
Exec=/opt/google/chrome/chrome %U
就解决了问题