Version 81 (4044) RegisterCustomSchemes

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.

Version 81 (4044) RegisterCustomSchemes

Postby ebahar » Sun Apr 19, 2020 10:00 am

Hi,
i notice that in the new CEF version (81),
when adding RegisterCustomSchemes and register custom Scheme
at

Code: Select all
void CefContentClient::AddCustomScheme(const SchemeInfo& scheme_info) {
  DCHECK(!scheme_info_list_locked_);
  scheme_info_list_.push_back(scheme_info);

  if (CefContentBrowserClient::Get()) {
    CefContentBrowserClient::Get()->RegisterCustomScheme(
        scheme_info.scheme_name);
  }
}


CefContentBrowserClient::Get() is always null (create later),

in Cef79 is wasn't like that.
im running with -multi-threaded-message-loop flag.
ebahar
Techie
 
Posts: 46
Joined: Tue Nov 22, 2016 3:52 am

Re: Version 81 (4044) RegisterCustomSchemes

Postby ebahar » Sun Apr 19, 2020 1:11 pm

from look at content_main_runner_impl.cc,
RegisterContentSchemes()
is now called before:
ContentClientInitializer::Set(process_type, delegate_)
which initialized thecontent::ContentBrowserClient* at CefMainDelegate::CreateContentBrowserClient().

so now:
csutom scheme are not RegisterCustomScheme at:
Code: Select all
void CefContentBrowserClient::RegisterCustomScheme(const std::string& scheme) {
  // Register as a Web-safe scheme so that requests for the scheme from a
  // render process will be allowed in resource_dispatcher_host_impl.cc
  // ShouldServiceRequest.
  content::ChildProcessSecurityPolicy* policy =
      content::ChildProcessSecurityPolicy::GetInstance();
  if (!policy->IsWebSafeScheme(scheme))
    policy->RegisterWebSafeScheme(scheme);
}


and on some cases (when using custom scheme inside other custom scheme) to block to request
because the scheme not mark as IsWebSafeScheme
ebahar
Techie
 
Posts: 46
Joined: Tue Nov 22, 2016 3:52 am

Re: Version 81 (4044) RegisterCustomSchemes

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

Please add a bug, and include a reproduction case.
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 52 guests