Load Html Code with local Files

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.

Load Html Code with local Files

Postby FEssig » Tue Aug 29, 2017 1:59 am

Hi,

I know there have been other topics addressing this issue but I couldn't find a solution yet.

I updated from CEF 3.2704.1431 to 3.3112.1656 and I'm wokring with Win10.

I need to load html code which contains links to local files (for example *.css or images). In the old version it worked by using
Code: Select all
browser->GetMainFrame()->LoadString(html.toStdWString(), "file:///local");

And CefRequestHandler::GetResourceHandler returned my Custom Scheme Handler which was used to load the local files.

The problem with the current version is that the GetResourceHandler function is not called when using the same code. I've seen other topics where it's stated that instead of using LoadString() a data uri should be used. But I've tried this and using a data uri won't trigger the GetResourceHandler function either. Which means I can't load my local files.

Any ideas how to load html code with links to local files?
FEssig
Techie
 
Posts: 12
Joined: Tue Feb 02, 2016 11:36 am

Re: Load Html Code with local Files

Postby magreenblatt » Tue Aug 29, 2017 10:05 am

magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: Load Html Code with local Files

Postby FEssig » Thu Aug 31, 2017 12:36 am

Ok thank you for your answer.
But that means that I have to change all the file:// links which are already in the software generated html code.
I hoped there was a different solution but it seems like I'll have to do it this way.
FEssig
Techie
 
Posts: 12
Joined: Tue Feb 02, 2016 11:36 am


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 29 guests