Loading local files to cefclient

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.

Loading local files to cefclient

Postby fernandomorgan » Mon Apr 07, 2014 7:02 pm

Hi, I was trying to load a local file (just a plain HTML file with static text - hello world), in cefclient (3.1921.1643).

I added this to

settings.universal_access_from_file_urls = STATE_ENABLED;
settings.file_access_from_file_urls = STATE_ENABLED;
settings.web_security = STATE_DISABLED;

before
CefBrowserHost::CreateBrowser(window_info, g_handler.get(),
g_handler->GetStartupURL(), settings, NULL);


and tried to load a local file

file:///Users/USERNAME/test1.html

but it fails to load the html file with error -10.

exactly the same test, in 3.1846.1637, works successfully.

Some new setting that I am missing? thanks.
fernandomorgan
Techie
 
Posts: 28
Joined: Tue Jan 14, 2014 5:51 pm

Re: Loading local files to cefclient

Postby magreenblatt » Mon Apr 07, 2014 9:29 pm

What OS are you testing on, and are you using the 32- or 64-bit CEF build? None of those settings should be necessary to load a simple static html page.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Loading local files to cefclient

Postby fernandomorgan » Tue Apr 08, 2014 12:27 pm

Mac OSX 10.9.2, 64 bit one, using the cefclient built from

cef_binary_3.1921.1643_macosx64

and

cef_binary_3.1846.1637_macosx64 (it works well here)
fernandomorgan
Techie
 
Posts: 28
Joined: Tue Jan 14, 2014 5:51 pm

Re: Loading local files to cefclient

Postby fernandomorgan » Wed Apr 09, 2014 12:18 pm

With CEF 3.1921.1645 - MacOSX 10.9.2 64bit,

and in cefsimple

url = "file:///Users/USERNAME/test1.html";

where test1.html is just an hello world html only page, I get

Failed to load URL file:///Users/USERNAME/test1.html with error (-10).
fernandomorgan
Techie
 
Posts: 28
Joined: Tue Jan 14, 2014 5:51 pm

Re: Loading local files to cefclient

Postby fernandomorgan » Wed Apr 09, 2014 12:25 pm

I tried also with the 32 bit version, from cef_binary_3.1921.1645_macosx32

Using xcode 5.1 and tried both with the 10.8 and 10.9 SDK (10.7 isn't available in 5.1)
fernandomorgan
Techie
 
Posts: 28
Joined: Tue Jan 14, 2014 5:51 pm

Re: Loading local files to cefclient

Postby magreenblatt » Wed Apr 09, 2014 12:37 pm

Thanks, I'm able to reproduce the problem and have filed https://code.google.com/p/chromiumembed ... il?id=1249.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Loading local files to cefclient

Postby magreenblatt » Wed Apr 09, 2014 12:59 pm

This is now fixed in trunk revision 1647.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Loading local files to cefclient

Postby fernandomorgan » Wed Apr 09, 2014 1:04 pm

Awesome! thank you!
fernandomorgan
Techie
 
Posts: 28
Joined: Tue Jan 14, 2014 5:51 pm


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 34 guests