Sandboxing in CEF

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Re: Sandboxing in CEF

Postby magreenblatt » Wed Dec 11, 2019 11:48 pm

Look at the callbacks in CefRenderProcessHandler.
magreenblatt
Site Admin
 
Posts: 12383
Joined: Fri May 29, 2009 6:57 pm

Re: Sandboxing in CEF

Postby harsh » Thu Dec 12, 2019 12:38 am

I tried in OnBrowserCreated and it is working. It is unable to write in a file from this function if the sandbox is enabled otherwise it is able to write to the file.
Thanks!!!
harsh
Techie
 
Posts: 28
Joined: Mon Dec 09, 2019 11:17 am

Re: Sandboxing in CEF

Postby harsh » Wed Jan 15, 2020 5:58 am

Hi,

Code: Select all
CefExecuteProcess(main_args, app.get(), sandbox_info);


When running as a single executable, CefExecuteProcess causes the sub-process to go the main of our executable which tries to launch the app. As our command-line arguments are different, the app launch fails (which is correct) but because the CEF sub-process did not get its required CefExecuteProcess function, the browser too is not displayed.

We are thinking of checking the arguments and placing an if condition in our main on whether to start our main app flow or CEF flow.

Earlier because we were not using sandboxing, we were using two executables. the sub-process was set in settings.browser_subprocess_path

Is that the right way?

Thanks!
harsh
Techie
 
Posts: 28
Joined: Mon Dec 09, 2019 11:17 am

Re: Sandboxing in CEF

Postby magreenblatt » Wed Jan 15, 2020 8:51 am

harsh wrote:We are thinking of checking the arguments and placing an if condition in our main on whether to start our main app flow or CEF flow.

You can check for the --type=xxx command-line flag which is used by Chromium for sub-processes.
magreenblatt
Site Admin
 
Posts: 12383
Joined: Fri May 29, 2009 6:57 pm

Re: Sandboxing in CEF

Postby harsh » Fri Jan 24, 2020 7:41 am

After sandboxing, sometimes 3 and sometimes 4 sub-processes are created. Is this an expected behavior or only a fixed number of sub-processes should be spawned?

1 utility and 2 or 3 render sub-processes
harsh
Techie
 
Posts: 28
Joined: Mon Dec 09, 2019 11:17 am

Re: Sandboxing in CEF

Postby magreenblatt » Fri Jan 24, 2020 9:26 am

harsh wrote:After sandboxing, sometimes 3 and sometimes 4 sub-processes are created. Is this an expected behavior or only a fixed number of sub-processes should be spawned?

1 utility and 2 or 3 render sub-processes

This is normal with site isolation. See comments here.
magreenblatt
Site Admin
 
Posts: 12383
Joined: Fri May 29, 2009 6:57 pm

Re: Sandboxing in CEF

Postby harsh » Fri Jan 24, 2020 9:56 am

Thanks!!

Also, CEF browser is not loading URL intermittently and a blank grey screen is displayed. This happens in 1 out of 10 cases. The debug logs give the following errors/info:

Code: Select all
INFO:download_manager_delegate.cc(334) Rejected download of [url]

This is seen every time the URL is not loaded.

Code: Select all
INFO:CONSOLE(1)] "Uncaught SyntaxError: Invalid or unexpected token", source: [some javascript file]

This is seen everytime, irrespective of whether URL is loaded or not loaded.

CEF version: 78.3.3 on Windows

What could be the possible reason? Recently, we upgraded to version 78.3.3 from version 3, added sandboxing and removed caching. Could any of these be the cause of this issue? We were not facing any issues earlier.
harsh
Techie
 
Posts: 28
Joined: Mon Dec 09, 2019 11:17 am

Re: Sandboxing in CEF

Postby magreenblatt » Fri Jan 24, 2020 10:17 am

How are you loading the resources? Are you intercepting or filtering the requests/responses in any way?
magreenblatt
Site Admin
 
Posts: 12383
Joined: Fri May 29, 2009 6:57 pm

Re: Sandboxing in CEF

Postby harsh » Fri Jan 24, 2020 11:09 am

No, we are not filtering the requests. We have been able to reproduce this issue on only one test machine that too occurs intermittently.

We tried to replicate the same after re-enabling the cache. It seemed to solve the issue and no blank screen was observed. Could it be an acceptable solution or as the issue is occurring intermittently, it was just a chance that no blank screen was observed?
harsh
Techie
 
Posts: 28
Joined: Mon Dec 09, 2019 11:17 am

Re: Sandboxing in CEF

Postby magreenblatt » Fri Jan 24, 2020 12:36 pm

harsh wrote:We tried to replicate the same after re-enabling the cache. It seemed to solve the issue and no blank screen was observed. Could it be an acceptable solution or as the issue is occurring intermittently, it was just a chance that no blank screen was observed?

I don't understand what you're asking here.

If the issue is only occuring on one machine then it's likely some issue with that machine. How does Google Chrome behave on that machine? Do you have up-to-date OS and drivers installed?
magreenblatt
Site Admin
 
Posts: 12383
Joined: Fri May 29, 2009 6:57 pm

Previous

Return to Support Forum

Who is online

Users browsing this forum: No registered users and 41 guests