You might be able to fake it by making one Firefox window the parent of another. I did a quick proof of concept using SetParent
on two Firefox windows running in separate processes with different profile paths:

The inner window is definitely a sub-window of the outer window here. For example, if you try to maximise the inner window it simply expands to fill the outer window.
However, you can't a window a child of a tab, because a tab is not a window. To achieve the illusion of having the window embedded in a tab, you'd have to listen for when the current tab changes (gBrowser.tabContainer.addEventListener("TabSelect", f)
) and switch to the correct sub-window for that tab. You can use SetWindowPos
to resize and reposition the sub-window to fill the tab content area.
To slice off the chrome elements (window border, toolbars, etc.) you could either use SetWindowRgn
or perhaps delete those elements from the DOM of the sub-window.
You would also have to make sure the Firefox sub-processes get closed when the corresponding tab is closed.
Note that you can do all this from JavaScript using the foreign-function-interface: https://developer.mozilla.org/en-US/docs/Mozilla/js-ctypes
This may be a dodgy-arse solution, but honestly I can't think of anything else that could possibly be better, apart from re-evaluating your requirements. Firefox simply isn't designed to deal with more than one profile per process.