Which browser is used inside a V8 Context?

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.

Which browser is used inside a V8 Context?

Postby Arturo » Fri May 15, 2015 11:37 am

Hey there,

I've created one browser which runs some JS code I'd like to handle through my V8Handler.
While debugging I looked at my browser after creation (namely at OnAfterCreated) and inside my CefV8Handler::Execute method via CefV8Context::GetBrowser() and it seem to be different browser objects. As far as I know I have one browser with one frame and I was under the impression the context will use the single browser I have created, correct me if I'm wrong.

If perhaps another browser is created without my knowledge, is there a way for me to get the browser I have manually created (via CreateBrowser) from within my CefV8Handler?

Also, I would like to know what might be a good way to differentiate between various browsers I'm creating, as I intend to create several I would like to able to tell them apart from with my CefV8Handler::Execute method, I thought I could use the MainWindowHandle from the BrowserHost, but since I'm trying to render them off-screen (currently not attached to any window) I imagine that wouldn't work.

FYI, I'm running in single process mode under Windows

Any input would be greatly appreciated.
Arturo
Newbie
 
Posts: 3
Joined: Fri Apr 24, 2015 11:48 am

Re: Which browser is used inside a V8 Context?

Postby magreenblatt » Fri May 15, 2015 3:00 pm

CEF API objects cannot be compared by pointer. Use the CefBrowser::GetIdentifier() method if you need to compare.

FYI, I'm running in single process mode under Windows

Don't use single-process mode. It doesn't work in newer CEF branches and may be removed completely.
magreenblatt
Site Admin
 
Posts: 12408
Joined: Fri May 29, 2009 6:57 pm

Re: Which browser is used inside a V8 Context?

Postby meitis1 » Wed Sep 16, 2015 9:35 am

we also have c++ software that is tightly interacting with JS in our html5 so we have our V8Handler.
We are stuck with CEF1 because we can't use multi-process and whichever CEF3 build we tried to use in single-process mode it crashes.
But we need more and more features that are not well supported in CEF1. Now you're saying that it will be removed completely ?!
So are you saying we have no choice but to abandon CEF and look for some other embedded browser?
meitis1
Newbie
 
Posts: 8
Joined: Tue Sep 15, 2015 3:55 pm

Re: Which browser is used inside a V8 Context?

Postby magreenblatt » Wed Sep 16, 2015 9:55 am

meitis1 wrote:we also have c++ software that is tightly interacting with JS in our html5 so we have our V8Handler.
We are stuck with CEF1 because we can't use multi-process and whichever CEF3 build we tried to use in single-process mode it crashes.
But we need more and more features that are not well supported in CEF1. Now you're saying that it will be removed completely ?!
So are you saying we have no choice but to abandon CEF and look for some other embedded browser?

There are a number of supported ways to implement integration between C++ and JS code. See https://bitbucket.org/chromiumembedded/ ... cation-ipc for your options.
magreenblatt
Site Admin
 
Posts: 12408
Joined: Fri May 29, 2009 6:57 pm

Re: Which browser is used inside a V8 Context?

Postby meitis1 » Wed Sep 16, 2015 10:12 am

thank you magreenblatt.
It's been years since we use CEF1 :) and we tried many options but problem was always because we cannot let CEF run in multi-process mode i.e. we have to set flag single_process to TRUE as said in document you referred me to:"...single_process Set to true to use a single process for the browser and renderer. ..."(https://bitbucket.org/chromiumembedded/ ... cation-ipc).
We have simply many calls from JS back and forth. All works fine and has been working for years in CEF1 but we have to move forward and now we have more and more HTML5 code and we want some nice features available only in CEF3.

So my question is simply :
Does anyone know and can reassure me that CEF3 should work fine if flag 'single_process' is set to TRUE ? (was it been tested and proved to work fine with V8handler i.e. JS calls)
meitis1
Newbie
 
Posts: 8
Joined: Tue Sep 15, 2015 3:55 pm

Re: Which browser is used inside a V8 Context?

Postby magreenblatt » Wed Sep 16, 2015 10:56 am

meitis1 wrote:So my question is simply :
Does anyone know and can reassure me that CEF3 should work fine if flag 'single_process' is set to TRUE ? (was it been tested and proved to work fine with V8handler i.e. JS calls)

Unfortunately not. You will need to change your application. Whether you use CEF3 or not is up to you, however I doubt using some other browser will be less work.
magreenblatt
Site Admin
 
Posts: 12408
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 24 guests