Mailinglist Archive: opensuse (769 mails)

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

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

#! /bin/bash

ffpid=`pidof firefox`
ffexit=$?

echo "firefox PID is: $ffpid"

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

sleep 5

firefox -P list http://lists.opensuse.org/opensuse/2016-05/all.html &

exit


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,

Istvan

I'm not yet 100% sure what you want to achieve, i.e. what should happen
with the previous tab(s), 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.
--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.

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

Have a nice day,
Berny
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse+owner@xxxxxxxxxxxx

< Previous Next >
Follow Ups
References