Separated Browsers with their own v8 extensions in one app

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.

Separated Browsers with their own v8 extensions in one app

Postby payalord » Sat Jun 06, 2020 8:12 pm

Hi, I have a problem. Is it possible to implement in 1 application 2 Cef Browsers with their own separated CefRenderProcessHandler, where in OnWebKitInitialized they will load their own v8 extensions?
For example first browser I'm planning to use for App UI and custom extensions there must not be available in 2nd browser in the App, which I plan to use as a browser for the user.
payalord
Techie
 
Posts: 21
Joined: Sun Jan 07, 2018 8:21 am

Re: Separated Browsers with their own v8 extensions in one a

Postby amaitland » Sat Jun 06, 2020 9:07 pm

You can use a CefRequestContext to isolate your browser instances so they have a different render process.

https://magpcss.org/ceforum/apidocs3/projects/(default)/CefRequestContext.html
Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1292
Joined: Wed Jan 14, 2015 2:35 am

Re: Separated Browsers with their own v8 extensions in one a

Postby payalord » Sat Sep 19, 2020 11:12 am

Can you please provide a simple example? Since I really don't understand how is possible to use the solution you suggested, thanks.
payalord
Techie
 
Posts: 21
Joined: Sun Jan 07, 2018 8:21 am

Re: Separated Browsers with their own v8 extensions in one a

Postby ndesktop » Sun Sep 20, 2020 12:59 am

Look in ceftests/ for GetRequestContext(RootWindow*) and the usage of request_context_per_browser_ (if true creates one per browser, otherwise creates a single shared context).
You will probably need to implement also a CefRequestContext::GetHandler() and a CefRequestContextHandler.

Or you can implement your own CefRequestContext, but that is no easy task.
ndesktop
Master
 
Posts: 756
Joined: Thu Dec 03, 2015 10:10 am

Re: Separated Browsers with their own v8 extensions in one a

Postby payalord » Sat Oct 17, 2020 3:56 pm

Ok thanks, I'll take a look into it.
payalord
Techie
 
Posts: 21
Joined: Sun Jan 07, 2018 8:21 am


Return to Support Forum

Who is online

Users browsing this forum: Majestic-12 [Bot] and 21 guests