url navigation for chrome:// scheme

Having problems with building or using the CefGlue .NET/Mono binding? Ask your questions here.

Moderator: fddima

url navigation for chrome:// scheme

Postby Panneerselvam » Sat Apr 15, 2017 2:12 am

Hi,
I have integrated CEF 2987 to my project and it's working fine for regular URL schemes like http, https, ws, wss and file (I am setting these schemes using SetCookieableSchemes). I want to make sure, all "chrome://" schemes are accessible from my application. I could see that, it works as part of cefclient test application but i am not able to access URLs like chrome://version from my application. Can you please point me to how to enable chrome:// urls from my application?
Thanks!!!
Panneerselvam
Newbie
 
Posts: 9
Joined: Thu May 29, 2014 3:36 am

Re: url navigation for chrome:// scheme

Postby magreenblatt » Sat Apr 15, 2017 9:35 am

Are you including all of the *.pak files in your application?
magreenblatt
Site Admin
 
Posts: 8590
Joined: Fri May 29, 2009 6:57 pm

Re: url navigation for chrome:// scheme

Postby Panneerselvam » Sun Apr 16, 2017 2:57 am

Yes, i have following pak files included in my application: cef, cef_100_percent, cef_200_percent, cef_extension and devtools_resources.
Panneerselvam
Newbie
 
Posts: 9
Joined: Thu May 29, 2014 3:36 am

Re: url navigation for chrome:// scheme

Postby fddima » Mon Apr 17, 2017 7:55 am

In CefGlue.Demo application chrome:// scheme works as expected.
fddima
Master
 
Posts: 765
Joined: Tue Dec 07, 2010 6:10 am

Re: url navigation for chrome:// scheme

Postby Panneerselvam » Tue Apr 18, 2017 12:49 am

I think, i am missing an initialization step for making the chrome:// scheme to work. I am trying to find this. Any help here? Thanks!!!
Panneerselvam
Newbie
 
Posts: 9
Joined: Thu May 29, 2014 3:36 am

Re: url navigation for chrome:// scheme

Postby fddima » Tue Apr 18, 2017 1:34 am

It is not needed any special step to make it work. Check that all files are in place... then check you code. May be you somewhere accidentally block it.
fddima
Master
 
Posts: 765
Joined: Tue Dec 07, 2010 6:10 am

Re: url navigation for chrome:// scheme

Postby cherzog » Wed Jun 27, 2018 12:50 pm

Hello.

I'm running the following CEF build:

3.3325.1746.ge81cdf2_windows32

Downloaded from here:

http://opensource.spotify.com/cefbuilds ... 32.tar.bz2

I'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.
cherzog
Newbie
 
Posts: 4
Joined: Tue Jun 26, 2018 6:56 pm

Re: url navigation for chrome:// scheme

Postby Czarek » Thu Jun 28, 2018 3:37 am

Try running cefclient demo at the same CEF version and see if it works there. You can download sample apps from Spotify builds.
Maintainer of the CEF Python, PHP Desktop and CEF2go projects. Programmer for hire, see my Resume.
User avatar
Czarek
Genius
 
Posts: 1341
Joined: Sun Nov 06, 2011 2:12 am
Location: Poland


Return to CefGlue Forum

Who is online

Users browsing this forum: No registered users and 2 guests