Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
If you find these projects useful please consider becoming a sponsor with Patreon, GitHub or Liberapay.

Sandbox Issue When Launching MiniBrowser Twice with CEF 126

Post Reply
patrick.rohrbacher
Posts: 2
Joined: Thu Feb 24, 2022 10:05 am

Sandbox Issue When Launching MiniBrowser Twice with CEF 126

Post by patrick.rohrbacher »

Hello,

I am encountering an issue related to the Chromium Embedded Framework (CEF 126) while using the MiniBrowser demo application. When I launch the MiniBrowser twice, the Chromium processes start with the following message:
--no-sandbox stability and security will suffer

How can we avoid this problem?

How can we make it possible for two processes to be launched simultaneously?
User avatar
salvadordf
Posts: 4563
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Sandbox Issue When Launching MiniBrowser Twice with CEF 126

Post by salvadordf »

Hi,

Read the information in these links about the limitations when we try to launch several instances of the same application with a CEF browser :
https://www.briskbard.com/forum/viewtopic.php?t=2208
https://stackoverflow.com/questions/78652092/cef4delphi-application-cant-run-two-instances

It's not possible to enable the sandbox in Delphi applications.
patrick.rohrbacher
Posts: 2
Joined: Thu Feb 24, 2022 10:05 am

Re: Sandbox Issue When Launching MiniBrowser Twice with CEF 126

Post by patrick.rohrbacher »

Okay, thanks for the response. Here is the solution I implemented, which allows me to have the same cache or less when I run the application only once

function getCacheName(const prefix: String = 'cache'): String;
var
i: Integer;
sDir: String;
begin
sDir:= ExtractFileDir(ParamStr(0));
sDir:= IncludeTrailingPathDelimiter(sDir);
for i:= 1 to 100 do begin
result:= prefix + i.ToString;
if not(FileExists(IncludeTrailingPathDelimiter(sDir + result) + 'lockfile')) then exit;
end;
end;



procedure CreateGlobalCEFApp;
begin
GlobalCEFApp:= TCefApplication.Create;
GlobalCEFApp.cache:= getCacheName();
GlobalCEFApp.EnablePrintPreview:= True;
GlobalCEFApp.EnableGPU:= True;
GlobalCEFApp.LogFile:= 'debug.log';
GlobalCEFApp.LogSeverity:= LOGSEVERITY_INFO;
GlobalCEFApp.UncaughtExceptionStackSize:= 50;
GlobalCEFApp.OnUncaughtException:= GlobalCEFApp_OnUncaughtException;
GlobalCEFApp.ChromeRuntime:= True;
end;
Post Reply