diff --git a/src/dullahan.h b/src/dullahan.h index 4049bc9..e7151e1 100644 --- a/src/dullahan.h +++ b/src/dullahan.h @@ -161,6 +161,7 @@ class dullahan bool use_mock_keychain = false; // like adding --use-mock-keychain to Chrome command line bool autoplay_without_gesture = false; // like adding --autoplay-policy=???? to Chrome command line bool fake_ui_for_media_stream = false; // like adding --fake-ui-for-media-stream to Chrome command line + bool disable_cookie_database_locking = true;// like adding --disable-features=LockProfileCookieDatabase to the Chrome command line bool flash_enabled = true; // system flash plugin bool force_wave_audio = false; // forces Windows WaveOut/In audio bool image_shrink_standalone_to_fit = true; // scale standalone images larger than browser size to fit diff --git a/src/dullahan_impl.cpp b/src/dullahan_impl.cpp index 121ff88..b6561a6 100644 --- a/src/dullahan_impl.cpp +++ b/src/dullahan_impl.cpp @@ -72,6 +72,7 @@ dullahan_impl::dullahan_impl() : mUseMockKeyChain(false), mAutoPlayWithoutGesture(false), mFakeUIForMediaStream(false), + mDisableCookieDatabaseLocking(true), mFlipPixelsY(false), mFlipMouseY(false), mRequestContext(nullptr), @@ -92,6 +93,8 @@ void dullahan_impl::OnBeforeCommandLineProcessing(const CefString& process_type, { if (process_type.empty()) { + std::vector disable_features; + // Enable HTMLImports to get youtube live chat to work command_line->AppendSwitchWithValue("enable-blink-features", "HTMLImports"); if (mMediaStreamEnabled == true) @@ -133,7 +136,7 @@ void dullahan_impl::OnBeforeCommandLineProcessing(const CefString& process_type, if (mDisableNetworkService) { - command_line->AppendSwitchWithValue("disable-features", "NetworkService"); + disable_features.push_back("NetworkService"); } if (mUseMockKeyChain) @@ -156,6 +159,25 @@ void dullahan_impl::OnBeforeCommandLineProcessing(const CefString& process_type, command_line->AppendSwitchWithValue("--proxy-server", mProxyHostPort); } +#ifdef WIN32 + if (mDisableCookieDatabaseLocking) + { + disable_features.push_back("LockProfileCookieDatabase"); + } +#endif + + if (!disable_features.empty()) + { + std::ostringstream disabled_features; + + for (size_t i = 0, n = disable_features.size(); i < n; ++i) { + if (i > 0) disabled_features << ','; + disabled_features << disable_features[i]; + } + + command_line->AppendSwitchWithValue("disable-features", disabled_features.str()); + } + platformAddCommandLines(command_line); } } @@ -381,6 +403,12 @@ bool dullahan_impl::initCEF(dullahan::dullahan_settings& user_settings) // provide their own ("Allow, "Disallow") UI. mFakeUIForMediaStream = user_settings.fake_ui_for_media_stream; + // this flag if set, disables a security measure introduced in Chrome 114 for W32 that + // prevents multiple processes from accessing the cookie database. It is recommended to + // enable this if the application spawns more than one Dullahan process, or when multiple + // simultaneous instances of the application needs to be supported. + mDisableCookieDatabaseLocking = user_settings.disable_cookie_database_locking; + // if true, this setting inverts the pixels in Y direction - useful if your texture // coords are upside down compared to default for Dullahan mFlipPixelsY = user_settings.flip_pixels_y; diff --git a/src/dullahan_impl.h b/src/dullahan_impl.h index 5c7abe0..7b5dc54 100644 --- a/src/dullahan_impl.h +++ b/src/dullahan_impl.h @@ -166,6 +166,7 @@ class dullahan_impl : bool mUseMockKeyChain; bool mAutoPlayWithoutGesture; bool mFakeUIForMediaStream; + bool mDisableCookieDatabaseLocking; bool mFlipPixelsY; bool mFlipMouseY; double mRequestedPageZoom;