如何从终端控制Google Chrome


9

在Ubuntu中,要从命令行控制Opera,您可以使用以下命令

opera -remote "openURL(www.google.com)"

Google Chrome是否有类似的命令?使用命令

/usr/bin/google-chrome www.google.com

只是打开一个新窗口。


为我工作,并且应该可以正常工作。
Hasturkun 2011年

Answers:


8

chromix项目可能是你在找什么。它允许从命令行(或在脚本中)控制chrome及其标签。

免责声明:我是作者。


5

这对我有用,在Ubuntu Linux上的新Chrome窗口中打开我的个人网站:

google-chrome http://dotancohen.com

看来您缺少初始http://部分。



1

这是另一种(更通用的)方法(假设chrome是您的默认浏览器):

gnome-open http://superuser.com/

0

我会这样做chromium-browser(对于铬),或者google-chrome,而不是/usr/bin/google-chrome仅仅依赖于您的PATH,或者如果您真的想确切知道它的类型which google-chrome,它会为您提供路径,请注意该which命令会告诉您应用程序的静态位置

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.