Bug 1088180 - [e10s] after dragging tab to new window, links with target blank open in tabs in old window instead of current window
So the place that opens the new tab is in browser.js, in openURIInFrame. The thing that calls that is right here:

https://hg.mozilla.org/mozilla-central/file/8f57f60ee58a/dom/ipc/TabParent.cpp#l636

I suspect browserDOMWin is wrong - that this TabParent is confused about who its mama is.

https://hg.mozilla.org/mozilla-central/file/8f57f60ee58a/dom/ipc/TabParent.cpp#l598

browserDOMWin is mBrowserDOMWindow, which is set via SetBrowserDOMWindow.

Besides some forwarding, seems to only ever be called in nsFrameLoader's TryRemoteBrowser.

So perhaps we should be swapping the browser DOM Windows when we swap frame loaders?

Like, in nsFrameLoader::SwapWithOtherLoader? Is it that easy? Let's find out!

Whoops - accidentally implemented it in SwapWithOtherLoader instead of SwapWithOtherRemoteLoader.

Yay, it works! And smaug likes it! Pushed!