diff --git a/src/gui/app.cpp b/src/gui/app.cpp index 3eb12984..a14d697a 100644 --- a/src/gui/app.cpp +++ b/src/gui/app.cpp @@ -195,15 +195,26 @@ namespace loot { CefSettings LootApp::GetCefSettings() const { CefSettings cef_settings; - //Disable CEF logging. + //Disable CEF command line args. cef_settings.command_line_args_disabled = true; - if (_settings["Language"]) { + + // Don't set CEF locale, as it tries to load resources and crashes + // if they can't be found. + /*if (_settings["Language"]) { loot::Language lang(_settings["Language"].as()); CefString(&cef_settings.locale).FromString(lang.Locale()); - } + }*/ + + // Set CEF logging. + CefString(&cef_settings.log_file).FromString("CEFDebugLog.txt"); if (!_settings["Debug Verbosity"] || _settings["Debug Verbosity"].as() == 0) cef_settings.log_severity = LOGSEVERITY_DISABLE; + // Enable remote debugging. + //cef_settings.single_process = true; + cef_settings.remote_debugging_port = 8080; + + // Use cef_settings.resources_dir_path to specify Resources folder path. // Use cef_settings.locales_dir_path to specify locales folder path. @@ -266,8 +277,6 @@ namespace loot { message_router_->OnContextCreated(browser, frame, context); _context = context; - - InitJSVars(); } void LootApp::OnContextReleased(CefRefPtr browser, diff --git a/src/gui/main_win.cpp b/src/gui/main_win.cpp index c23e07a2..e21891f9 100644 --- a/src/gui/main_win.cpp +++ b/src/gui/main_win.cpp @@ -123,11 +123,6 @@ int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmd return 0; } - // Do application init - //-------------------- - - app.get()->Init(gameStr); - // Back to CEF //------------ @@ -137,6 +132,11 @@ int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmd // Initialize CEF. CefInitialize(main_args, cef_settings, app.get(), sandbox_info); + // Do application init + //-------------------- + + app.get()->Init(gameStr); + // Run the CEF message loop. This will block until CefQuitMessageLoop() is called. CefRunMessageLoop();