Mailinglist Archive: opensuse (769 mails)

< Previous Next >
Re: [opensuse] start firefox from script
Bernhard Voelker írta:
On 05/16/2016 09:01 PM, Istvan Gabor wrote:

I would like to start firefox browser from bash script. I made this script:

#! /bin/bash

ffpid=`pidof firefox`

echo "firefox PID is: $ffpid"

if test $ffexit == 0
then `kill -9 $ffpid`

sleep 5

firefox -P list &


What I want is to check if firefox is running, if it's runing stop it and
start it again with specific profile with specific URL. This works with the
above script but the problem is if I run the script at least two times, the
second time firefox opens with two tabs, with the same content in both tabs.
How can I force it to open only on tab with the URL in the command line
specified? In firefox preferences I've set General/Startup: When firefox
start: Show a blank page. I use an old firefox version (24.8.1 ESR, the last
ESR that doesn't have australis uinterface), I don't know if it matters.

Thanks in advance,


I'm not yet 100% sure what you want to achieve, i.e. what should happen
with the previous tab(s),


I expect that when the browser is restarted, only one tab is opened with the
URL specified on the command line. I need this because I want to record flash
streams which can be played in a browser. I need only one flash stream opened
at at time or else they interfere.

but I'd look at the other options mentions
in --help output; some sound promising:

--no-remote Do not accept or send remote commands; implies
--new-instance Open new instance, not a new window in running instance.
--browser Open a browser window.
--new-window <url> Open <url> in a new window.
--new-tab <url> Open <url> in a new tab.
--private-window <url> Open <url> in a new private window.

All these options are useless in my case as I need exactly only one browser
window with only one site/tab opened at a time. Either a separarate window or a
second tab interferes (the sound from the stream) with the other one.

Maybe you even need to kill your normal browser window (running with
a different profile).

The script kills the browser. When it starts again it should open only one site
in one tab. But in my case it opens two tabs: the one was opened before closing
the browser and another one which is specified on the command line.


To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse+owner@xxxxxxxxxxxx

< Previous Next >
Follow Ups