diff --git a/camino/src/embedding/CHBrowserListener.mm b/camino/src/embedding/CHBrowserListener.mm index df6a639c623..276961a63b4 100644 --- a/camino/src/embedding/CHBrowserListener.mm +++ b/camino/src/embedding/CHBrowserListener.mm @@ -232,9 +232,12 @@ CHBrowserListener::ProvideWindow(nsIDOMWindow *inParent, PRUint32 inChromeFlags, if (prefersTabs) { CHBrowserView* newContainer = [mContainer reuseExistingBrowserWindow:inChromeFlags]; nsCOMPtr contentWindow = [newContainer getContentWindow]; - *outDOMWindow = contentWindow.get(); - *outWindowIsNew = PR_TRUE; - NS_IF_ADDREF(*outDOMWindow); + + // make sure gecko knows whether we're creating a new browser window (new tabs don't count) + nsCOMPtr currentWindow = [mView getContentWindow]; + *outWindowIsNew = (contentWindow != currentWindow); + + NS_IF_ADDREF(*outDOMWindow = contentWindow.get()); } return NS_OK;