diff --git a/xpfe/appshell/nsAppShellService.cpp b/xpfe/appshell/nsAppShellService.cpp index c9f987ad63b0..81511bfd9d5c 100644 --- a/xpfe/appshell/nsAppShellService.cpp +++ b/xpfe/appshell/nsAppShellService.cpp @@ -671,22 +671,21 @@ nsresult nsAppShellService::JustCreateTopWindow( widgetInitData.mRTL = LocaleService::GetInstance()->IsAppLocaleRTL(); - nsresult rv = - window->Initialize(parent, center ? aParent : nullptr, aInitialWidth, - aInitialHeight, aIsHiddenWindow, widgetInitData); - - NS_ENSURE_SUCCESS(rv, rv); - // Enforce the Private Browsing autoStart pref first. bool isPrivateBrowsingWindow = StaticPrefs::browser_privatebrowsing_autostart(); - if (aChromeMask & nsIWebBrowserChrome::CHROME_PRIVATE_WINDOW) { // Caller requested a private window isPrivateBrowsingWindow = true; } widgetInitData.mIsPrivate = isPrivateBrowsingWindow; + nsresult rv = + window->Initialize(parent, center ? aParent : nullptr, aInitialWidth, + aInitialHeight, aIsHiddenWindow, widgetInitData); + + NS_ENSURE_SUCCESS(rv, rv); + nsCOMPtr domWin = do_GetInterface(aParent); nsCOMPtr webNav = do_GetInterface(domWin); nsCOMPtr parentContext = do_QueryInterface(webNav);