diff --git a/atom/browser/atom_browser_main_parts.cc b/atom/browser/atom_browser_main_parts.cc index 7aac0faac3..aa48e8112d 100644 --- a/atom/browser/atom_browser_main_parts.cc +++ b/atom/browser/atom_browser_main_parts.cc @@ -328,9 +328,6 @@ void AtomBrowserMainParts::PreMainMessageLoopRun() { OSCrypt::SetConfig(std::move(config)); #endif - browser_context_ = ProfileManager::GetActiveUserProfile(); - brightray::BrowserMainParts::PreMainMessageLoopRun(); - js_env_.reset(new JavascriptEnvironment); js_env_->isolate()->Enter(); @@ -359,6 +356,9 @@ void AtomBrowserMainParts::PreMainMessageLoopRun() { node_bindings_->PrepareMessageLoop(); node_bindings_->RunMessageLoop(); + browser_context_ = ProfileManager::GetActiveUserProfile(); + brightray::BrowserMainParts::PreMainMessageLoopRun(); + #if defined(USE_X11) libgtkui::GtkInitFromCommandLine(*base::CommandLine::ForCurrentProcess()); #endif