Until you pointed out your programming / scripting language where you plan to use to find the Firefox window to install, I found this answer to SO to your exact question (both questions are essentially the same: find the ff window in x11).
In general, in firefox, each “tab container” is a window, and each tab is a window (therefore, you can load firefox ui inside firefox ui). This way you can search for firefox windows with a specific title or src / url.
.. gmail- firefox .. , . ( , :)?)
( " gmail" ) (-bar) ( FaceFox?) , javascript - ..).
: