I'm doing some automation with Firefox and although I can open Firefox window from shell, I'm not able to terminate it properly. If I kill
Firefox process with kill -3
or kill -2
command the next time I open a new Firefox window it asks me if I want to run in safe-mode. I understand that calling kill -9
could confuse Firefox so it would try to run in safe-mode but -3
should be fine.
Do you have any idea how to gently tell Firefox to close properly?
First Run xkill command after that click on window which one you want close
You can use
pkill
with the process name:How about
?
Is it what you want?
NOTEs:
You can first get the Pid of firefox with
and after use kill to stop firefox kill [pid]
For Firefox in OSX:
In Mac OS X, you could use AppleScript to close it (adjust the application name as necessary; I don't have FireFox installed to test):
This should trigger the same event that the Quit menu command triggers, so FireFox should shut down cleanly.
Obviously, this won't work in Linux.