How to support custom schemes dynamic?

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.

How to support custom schemes dynamic?

Postby Streamlet » Wed Aug 28, 2019 2:03 am

So far as I known, application must call CefSchemeRegistrar::AddCustomScheme in CefApp::OnRegisterCustomSchemes to register a custom sheme to set options.
It is OK for static schemes. "static" means when we write the code we already known what schemes to register.
In my case, I am writeing a webbrowser control using CEF, and I need to exposing an API to users to register custom schemes after browser process created.
CefApp::OnRegisterCustomSchemes is called on CefInitialize, that is too early for me. My walkaround is delay the creating of browser process and pass a command line swich like "--schemes=scheme1,sheme2".
Could you please provide a better mechanism for us?

Additionally, I am puzzled why we need to call CefSchemeRegistrar::AddCustomScheme on each process, including gpu process and utility process?
Would you please wrapper it inside CEF?
Streamlet
Mentor
 
Posts: 61
Joined: Tue Aug 27, 2019 6:47 am

Re: How to support custom schemes dynamic?

Postby magreenblatt » Wed Aug 28, 2019 9:56 am

Streamlet wrote:Could you please provide a better mechanism for us?

Unfortunately not, as this early registration is a Chromium architectural requirement.

Streamlet wrote:Additionally, I am puzzled why we need to call CefSchemeRegistrar::AddCustomScheme on each process, including gpu process and utility process?
Would you please wrapper it inside CEF?

Why is this a problem for you?
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: How to support custom schemes dynamic?

Postby Streamlet » Wed Aug 28, 2019 9:10 pm

magreenblatt wrote:
Streamlet wrote:Could you please provide a better mechanism for us?

Unfortunately not, as this early registration is a Chromium architectural requirement.


Thank you for reply. I understand that very well.
Streamlet
Mentor
 
Posts: 61
Joined: Tue Aug 27, 2019 6:47 am

Re: How to support custom schemes dynamic?

Postby Streamlet » Wed Aug 28, 2019 9:21 pm

magreenblatt wrote:
Streamlet wrote:Additionally, I am puzzled why we need to call CefSchemeRegistrar::AddCustomScheme on each process, including gpu process and utility process?
Would you please wrapper it inside CEF?

Why is this a problem for you?


Because the browser process got info about custom scheme from app.
Then I need to pass it to other processes through command line, as the early registration requirement.
Not so convenient for use. I think it might be better that CEF treats the custom scheme as its own resoponsibility and does all what needed.
Well, it is not a very big problem, only a litter litter litter inconvenient. ^_^
Streamlet
Mentor
 
Posts: 61
Joined: Tue Aug 27, 2019 6:47 am

Re: How to support custom schemes dynamic?

Postby magreenblatt » Wed Aug 28, 2019 9:37 pm

In most cases the list of custom schemes is static (doesn’t change for a given application), so passing it dynamically in all cases would be wasteful.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: How to support custom schemes dynamic?

Postby Streamlet » Wed Aug 28, 2019 9:49 pm

OK. I see.
Streamlet
Mentor
 
Posts: 61
Joined: Tue Aug 27, 2019 6:47 am


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 53 guests