You can also choose from three options:
1) Always minimize to the tray instead of to the taskbar.
2) Minimize to tray on close.
3) Require a double click to restore from the tray.
To get this feature enabled for Firefox, Install ‘Minimize to Tray’ Firefox Add-on from here.
To customize this add-on, go to Tools menu of Firefox and the n click Add-ons.
Now select Minimize to Tray Add-on and click options.
This will open the options window. Check the options you like.