从命令行打开多个 Firefox 选项卡

And*_*y J 26 command-line firefox

我正在尝试firefox使用命令行中的两个选项卡打开,并使用两个单独的网址。到目前为止,我没有运气。

firefox -new-tab https://www.evernote.com/Home.action -new-tab http://www.gmail.com
Run Code Online (Sandbox Code Playgroud)

有人能指出我正确的方向吗?

And*_*y J 30

哎呀。我刚刚找到了答案。您需要-url在每个“-new-tab”之后添加一个。

firefox -new-tab -url https://www.evernote.com/Home.action -new-tab -url http://www.gmail.com
Run Code Online (Sandbox Code Playgroud)

现在它起作用了。希望这可以帮助某人。


Kap*_*wat 10

您不再需要添加-url,只需编写firefox后跟以空格分隔的 URL。

例子:

firefox mail.google.com askubuntu.com stackoverflow.com
Run Code Online (Sandbox Code Playgroud)


May*_*hux 7

创建一个包含名为 的 URL 列表的文件url.txt

http://www.url1.xxx
http://www.url2.xxx
http://www.url3.xxx
Run Code Online (Sandbox Code Playgroud)

Firefox 使用 new-tab 命令,因此您可以将文件中的 URL 传递给浏览器,如下所示:

xargs -a url.txt firefox -new-tab "$line"
Run Code Online (Sandbox Code Playgroud)