The long start up time of firefox is general, especially with many add-ons. Is there any way to run firefox as background in order to obtain faster start up speed? If under windows, I have no idea, but for linux, I have find a way to hide a window to achieve running a desktop application “background”.
xdotool is a tool designed for control gui under CLI.
xdotool has a option
windowunmap, which mean “unmap a window, make it no longer appear on your screen”.
$ xdotool windowunmap [WID]
WID is window’s ID, which can obtain from
xdotool search. A example for hiding a firefox window as follow(You must open a window of firefox):
$ xdotool windowunmap $(xdotool search --onlyvisible --name firefox)
And then the window of firefox disappears, whereas the pid can be seen of command
ps -aux |grep firefox.
However, if you set firefox as default web browser, and then click a url under other application, firefox will open with the HIDE WINDOW, rather than a new window. And then you close firefox, and you will find there is no firefox application running background.
There are two ways to solve the problem, the first one is use
firefox --new-window to replace firefox as default web browser command, the second one is to write a shell script to make firefox restart and hide after the firefox PID disappears.