CEF1: Can I override http scheme with Scheme Handler?

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.

CEF1: Can I override http scheme with Scheme Handler?

Postby Czarek » Tue Mar 19, 2013 1:23 pm

Hi there,

I'm not sure about that, I've read the comments in cef_scheme.h, but it's a bit
confusing. For example this sentence:

If |scheme_name| is a built-in scheme and no handler is returned by |factory|
then the built-in scheme handler factory will be called.


Why would I want to call CefRegisterSchemeHandlerFactory() with a factory that does
not return any handler?

There is probably a bug in the comment here:
If |scheme_name| is a custom scheme the CefRegisterCustomScheme() function
should be called for that scheme.

I couldn't find any function named "CefRegisterCustomScheme".

In this post [1] Marshall states that I can't override the file:// protocol, so this will also
be true for the http:// protocol?

Is my only option to use OnBeforeResourceLoad() to override the http:// protocol?

[1] viewtopic.php?p=6964#p6964
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am

Re: CEF1: Can I override http scheme with Scheme Handler?

Postby magreenblatt » Tue Mar 19, 2013 6:27 pm

Czarek wrote:In this post [1] Marshall states that I can't override the file:// protocol, so this will also
be true for the http:// protocol?

You can override HTTP protocol handling. Actually, now that I look at the code [1] it seems that you might be able to override the file handler as well (I haven't tested that, though, and I can't think of any advantages to doing so).

[1] https://code.google.com/p/chromiumembed ... impl.cc#53
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: CEF1: Can I override http scheme with Scheme Handler?

Postby Czarek » Tue Mar 19, 2013 6:57 pm

Thank you for clarifying.
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am

Re: CEF1: Can I override http scheme with Scheme Handler?

Postby JRub » Wed Mar 27, 2013 7:44 am

You can also provide a custom resource handler in CefClient::GetResourceHandler.
I use this strategy to override the file:// protocol and it works well.
CEF 3.1453.1255 on Windows 7 32bits
JRub
Mentor
 
Posts: 92
Joined: Wed Sep 19, 2012 8:32 am
Location: Paris, France


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 220 guests

cron