Hello.
I'm running the following CEF build:
3.3325.1746.ge81cdf2_windows32
Downloaded from here:
http://opensource.spotify.com/cefbuilds ... 32.tar.bz2I'm having trouble with chrome:// URLs not working in CEF.
They are being replaced with about:blank.
I downloaded the relevant CEF and Chromium source and debug symbols, and was able to determine that this seems to be happening due to some security filtering.
Here is the top of the call stack at the time when the URL check fails, and the chrome:// URL is replaced with about:blank...
libcef.dll!content::ChildProcessSecurityPolicyImpl::SecurityState::CanCommitURL(const GURL & url) Line 207 C++
libcef.dll!content::ChildProcessSecurityPolicyImpl::CanCommitURL(int child_id, const GURL & url) Line 744 C++
libcef.dll!content::ChildProcessSecurityPolicyImpl::CanRequestURL(int child_id, const GURL & url) Line 663 C++
libcef.dll!content::RenderProcessHostImpl::FilterURL(content::RenderProcessHost * rph, bool url, GURL *) Line 3270 C++
libcef.dll!content::RenderProcessHostImpl::FilterURL(bool url, GURL *) Line 3150 C++
libcef.dll!content::RenderFrameHostImpl::CreateNewWindow() Line 2893 C++
I searched for something I could change in my CEF configuration to prevent this filtering, but I have not yet found anything.
I tried CefAddCrossOriginWhitelistEntry(), but that did not seem to make a difference.
Is it possible that I have some setting which is inadvertently enabling this filtering?
Is anyone aware of something that can be done at the CEF layer to allow the chrome:// URLs to not be filtered out by this security check?
This seems to be the most relevant chunk of code, from child_process_security_policy_impl.cc near line 202:
- Code: Select all
// Determine whether permission has been granted to commit |url|.
bool CanCommitURL(const GURL& url) {
DCHECK(!url.SchemeIsBlob() && !url.SchemeIsFileSystem())
<< "inner_url extraction should be done already.";
// Having permission to a scheme implies permission to all of its URLs.
SchemeSet::const_iterator scheme_judgment(
scheme_policy_.find(url.scheme()));
if (scheme_judgment != scheme_policy_.end())
return true;
// Otherwise, check for permission for specific origin.
if (CanCommitOrigin(url::Origin::Create(url)))
return true;
// file:// URLs are more granular. The child may have been given
// permission to a specific file but not the file:// scheme in general.
if (url.SchemeIs(url::kFileScheme)) {
base::FilePath path;
if (net::FileURLToFilePath(url, &path))
return base::ContainsKey(request_file_set_, path);
}
return false; // Unmentioned schemes are disallowed.
}
Is there some way in CEF to whitelist the chrome scheme?
Am I blocking it somehow unintentionally?
Thanks very much.