From a shell script open a new tab in a specific instance of Firefox

隐身守侯 提交于 2019-12-04 17:02:10

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!

Unfortunately Firefox only supports one remote profile at a time, so all your command lines have to remote into the same process. (Mozilla Suite for Linux supported a per-profile remote, but then again it didn't support the -profile flag.)

On the other hand if you know all the URL(s) that you want to load in advance, then you can simply pass all of them on the Firefox command line, concatenated with | characters (but quoted to stop the shell interpreting them). So for instance if you want to start a new instance of the test profile opening the page www.google.ie (only), use firefox -no-remote -P test -browser www.google.ie

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!