I never have this problem, as I force Firefox to use just 1 window & open a new tab instead of a new window.
Under Tools -> Options -> Tabs:
set
Open links from other applications in to
a new tab in the most recent window
make sure the tickbox for
Force links that open new windows to open in: is turned on, & it's sub-option set to
a new tab.
Whether or not you turn off the next 2 tickboxes [
Hide the tab bar when only one web site is open and
select new tabs opened from links]or not is a matter of personal taste, but I have them turned off.
I'd also recommend having
Warn when closing multiple tabs turned on.
Additonally, I'd recommend getting the
Tab Mix Plus extension for Firefox. There are times when some of the above-mentioned options native to Firefox don't work, TMP fixes that & adds extra functionality.
TMP settings:
Links
Set the 1st 2 options to
Open in new tab.
Set
javascript popups to
Open all popups in tabs.
The
Prevent blank tabs when tabs when downloading files option is quite useful, just add any extensions you like to the list for it.
Set
Force to open in new tab to
Nothing.
Turn on the
Enable single Window mode option.
The options under Events, Display, Mouse, & Menu are a matter of personal preference.
Session
I strongly recommend enabling both the
Enable Session Manager and
Enable Crash Recovery options, as they are
very useful. The various options for those features are pretty self-explanatory, & a matter of personal preference.
I should probably add that 1 or more of the above may be the reason why sometimes Firefox will suddenly disappear behind another window or minimise if it's really thrashing the CPU - no idea why, & it's only mildly irritating, but thought I ought to mention it. It's easy to get back - either click its button on the task bar, or if part of the window is still visible just click on that.