New to CEF development

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.

New to CEF development

Postby krum » Sun Apr 19, 2020 1:31 am

Hello Everyone,

I recently got interested in the world of CEF/Chromium development.

Right now I am in the middle of building branch 2357 with "automate-git.py", it seems to be going well and I am excited to start tinkering.

I have just a simple question, once the build is complete, what is the procedure to updating code and re-building the project with my updated code? Do I use automate-git.py still?
Also, in that same light, if I were to make a repo for my own project, is it possible to have automate-git.py work with my own changes?

I may be getting ahead of myself, but I am really trying to understand the workflow best practices here.

Thanks!
krum
Techie
 
Posts: 17
Joined: Sun Apr 19, 2020 1:21 am

Re: New to CEF development

Postby magreenblatt » Sun Apr 19, 2020 2:30 pm

krum wrote:Right now I am in the middle of building branch 2357

Why are you building such an old branch? You should use a supported branch instead. If you are planning to make CEF/Chromium changes you can follow the instructions here.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: New to CEF development

Postby magreenblatt » Sun Apr 19, 2020 2:41 pm

krum wrote:I have just a simple question, once the build is complete, what is the procedure to updating code and re-building the project with my updated code? Do I use automate-git.py still?
Also, in that same light, if I were to make a repo for my own project, is it possible to have automate-git.py work with my own changes?

If you fork the CEF repository, you can use automate-git to build your fork using the --url command-line parameter. See here for git setup and usage recommendations.

If you do not intend to change CEF/Chromium then you should start with cef-project instead.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: New to CEF development

Postby krum » Sun Apr 19, 2020 3:24 pm

Hello, thanks for the response, I am using an old branch because I specifically want to support npapi.

I think I got ahead of myself and I don't really need to build the dll myself. I eventually found (after hours of learning) that I can hook into the library and do what I want with it.

My goal is for the browser to support multiple versions of flash, shockwave, Java applets etc... Ya know, the stuff that is dying out.

For the following questions, I don't expect a detailed response, maybe just class names and hints :)

Without modifying code in the ceflib.dll...

Is it possible to have multiple versions of flash with cef and "target" one specifically? I was browsing the web_plugin header and saw that I can manually choose a folder for plugins, but want sure if I can do it at runtime it or if I can use that refresh fiction during runtime and then refresh the plug-in.

Is it possible to determine if a plug-in makes http request? The goal would be to differentiate plugins making requests vs js. I couldn't find any info on this one try as I might.

If the answer to these are mostly yes, I will bang my head against it for hours and hours :D
krum
Techie
 
Posts: 17
Joined: Sun Apr 19, 2020 1:21 am

Re: New to CEF development

Postby magreenblatt » Sun Apr 19, 2020 3:41 pm

Chromium is not designed to load more than one Flash version at a time, but a range of version numbers should be supported (check what Flash versions existed at the same time as the branch you’re using). It should be possible to identify requests originating from plugins. Note that, given the age of the CEF/Chromium version that you’re using, I probably won’t be able to help you with specific technical details (because the code has changed a lot since that time).
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: New to CEF development

Postby krum » Mon Apr 20, 2020 10:14 am

Thanks for all of the info.

I am looking into using "CefRequestContextHandler::OnBeforePluginLoad" once I get the plugins setup I am going to see if it will attempt to load 2 plugins with the same MIME type, I at least want it to trigger twice, so I can pick the one I want to load. My alternate plan was to modify the MIME type resource on the DLL manually (which I hope to be trivial...these things never are right?)

I am still looking into the other one, and I hope to have a working build with flash by end of this week if my normal work permits it :-)

Is it non-trivial to have multiple versions of CEF dll in a project by simply re-naming it, I've actually never tried that before...I am guessing it will be more than that of course :lol:

Thanks for all the amazing support!
krum
Techie
 
Posts: 17
Joined: Sun Apr 19, 2020 1:21 am

Re: New to CEF development

Postby magreenblatt » Mon Apr 20, 2020 10:57 am

krum wrote:s it non-trivial to have multiple versions of CEF dll in a project by simply re-naming it

It's (probably) possible but not trivial. All of the DLLs would export the same symbols, so you would need some wrapper for dynamic loading and routing calls to the correct DLL handle.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: New to CEF development

Postby krum » Mon Apr 20, 2020 4:49 pm

Ah ok, so I really just need a wrapper DLL for each CEF version statically linked where I expose my own functions within unique classes/functions... been a while since I worked with C++, but I am falling back in stride.

That makes things a bit easier honesty, I can host unique logic based upon versions in their own DLL's then just use them as needed in my executable, which I wouldn't have to re-build every time.

I will experiment and try not to ask any dumb questions! :D

Thanks again!
krum
Techie
 
Posts: 17
Joined: Sun Apr 19, 2020 1:21 am

Re: New to CEF development

Postby krum » Fri Apr 24, 2020 12:11 am

Hello again,

Good news, I got the browser built! It works and runs and I have a few updates.

bad news for the OnBeforePluginLoad, it wasn't added until the version AFTER 2351, or rather, it was moved to the CefRequestContextHandler (literally the next branch, which is upsetting).

https://bitbucket.org/chromiumembedded/ ... fecbb09a67

The only function I can find that invokes it is in "request_handler_cpptoc.cc"
Code: Select all
int CEF_CALLBACK request_handler_on_before_plugin_load(
  // Execute
  bool _retval = CefRequestHandlerCppToC::Get(self)->OnBeforePluginLoad(
      CefBrowserCToCpp::Wrap(browser),
      CefString(url),
      CefString(policy_url),
      CefWebPluginInfoCToCpp::Wrap(info));


is there a way to hook into this? If not, I could try my hand at back-porting the changes above to 2357, but I am glad I at least made progress.

Edit
Oh wait, looking at this again, I bet I just have to use: CefRequestHandler instead of CefRequestContextHandler...hmm if that is the case, you can just ignore me :-)

Edit 2
I got it working, tested it with Java and it picked it up just fine, the only strange artifact was the Plugin Info had Chinese letters for the "GetVersion()" but I am going to assume this is an artifact of the install and NOT CEF's doing.
Code: Select all
CODE_DEBUG: ver = 佃䕄䑟䉅䝕›慰桴㴠


I am editing for anyone who comes behind me trying this.
krum
Techie
 
Posts: 17
Joined: Sun Apr 19, 2020 1:21 am


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 96 guests