salvadordf / CEF4Delphi

CEF4Delphi is an open source project to embed Chromium-based browsers in applications made with Delphi or Lazarus/FPC for Windows, Linux and MacOS.
https://www.briskbard.com/forum/
Other
1.19k stars 363 forks source link

StartMainProcess when another application instance is already running since CEF 120 #502

Closed mareksrom closed 5 months ago

mareksrom commented 5 months ago

When application using CEF is already running (eg. SimpleBrowser demo) then GlobalCEFApp.StartMainProcess resturns false even when it is main process. SimpleBrowser application is terminated, when application does not respect return value of StartMainProcess then CEF does not work...

Before CEF 120 this worked ok... It does not work even when it is completely different application using the same version of CEF even when using CEF binnaries in different directory... I mean it is not expected behavior...

salvadordf commented 5 months ago

Hi,

CEF has changed the way it initializes and now it checks if another app is running with the same RootCache setting.

This feature was added in CEF 120.1.8 : https://www.briskbard.com/forum/viewtopic.php?p=9337#p9337

See the code comments for GlobalCEFApp.OnAlreadyRunningAppRelaunch, GlobalCEFApp.RootCache and GlobalCEFApp.Cache.

Read this forum thread for more information : https://www.briskbard.com/forum/viewtopic.php?t=2208

mareksrom commented 5 months ago

Thanks for quick answer, it does work👍 Just for others who want to use only in-memory cache like me - now it is necessary to set unique RootCache directory (e.g. by process ID and delete this directory when the application is terminated) and Cache leave empty...