从shell脚本在Firefox的特定实例中打开一个新选项卡 [英] From a shell script open a new tab in a specific instance of Firefox

查看:1205
本文介绍了从shell脚本在Firefox的特定实例中打开一个新选项卡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个shell脚本创建Firefox配置文件,然后使用它们同时打开Firefox的多个实例。问题是如何在Firefox的特定实例中打开URL?



我尝试过

  firefox -CREATEPROFILE test 
firefox -P test -no-remote
firefox -P test -url www.google.ie

但试图使用测试配置文件打开URL的最后一部分不起作用,它总是在默认配置文件中打开。



有什么方法可以从命令行来告诉Firefox使用特定的配置文件打开一个URL?



谢谢。 >

编辑:我使用Linux,我不认为它可以做我想从命令行做的(但是,Firefox命令行选项没有完全记录,它可能是)。我的问题的一个解决方案是使用JavaScript来打开标签一旦浏览器被执行。我想改变默认配置文件我想打开每次我想加载一个新的URL的配置文件也可以工作。这需要在每次加载新网址时更改profiles.ini。

解决方案

是的,可以这样做,修改你的profiles.ini /username/.mozilla/firefox/profiles.ini)每次在不同的个人资料中打开网址时更改默认个人资料。



我知道这是一个有点痛苦,但它的工作和它的唯一的方式做到这一点。现在我可以同时打开多个Firefox实例/配置文件,并仍然打开新的选项卡,其中我想要的shell脚本中的任何实例。



YAY!


I have a shell script that creates Firefox profiles and then uses them to open multiple instances of Firefox simultaneously. The problem is how can I open a URL in a particular instance of Firefox?

I have tried

firefox -CREATEPROFILE test
firefox -P test -no-remote
firefox -P test -url www.google.ie

But the last part which is trying to open the URL using the test profile does not work, it always opens in the default profile.

Is there any way to tell Firefox from the command line to open a URL using a particular profile?

Thanks.

EDIT: I am using Linux, I don't think its possible to do what I want to do from the command line (However, Firefox command-line options are not fully documented so it could be possible). One solution to my problem would be to use JavaScript to open the tabs once the browser has been executed. I think changing the default profile to the profile I want to open each time I want to load a new URL may work also. This will require changes to profiles.ini each time a new URL is loaded. I haven't tested this but it looks promising.

解决方案

Yes this can be done, Modify your profiles.ini (/home/username/.mozilla/firefox/profiles.ini) to change the default profile each time you want to open a URL in a different profile.

I know this is a bit of a pain but it works and its the only way to do this. Now I can have multiple Firefox instances/profiles open simultaneously and still open new tabs in which ever instance I want from my shell script.

YAY!

这篇关于从shell脚本在Firefox的特定实例中打开一个新选项卡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆