My custom scheme must use absolute path

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.

My custom scheme must use absolute path

Postby bobogavin » Mon Nov 20, 2017 9:12 am

hi,
I use CefRegisterSchemeHandlerFactory(_T("location"), _T(""), new LocationSchemeHandlerFactory()) register a custom scheme in my application, but when I use "location://TestPage.html" for testing, the following html, the problem is image1 and image2, in develop tool, I can see requests for "location://TestPage.html" and ""location://TestGif1.gif", but no "location://TestGif2.gif".
Code: Select all
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <title>123</title>
</head>
<body>
        <div style="width:450px;height:800px;margin:10px;float:right">
            <img name="image1" src="location://TestGif1.gif" />
            <img name="image2" src="TestGif2.gif" />
        </div>
</body>
</html>


And when I debug cefclient, I found if I use "client://handler.html", I get request->GetURL() is "client://handler.html/", but in my application I only get "location://TestPage.html", not "location://TestPage.html/", where is '/' ? Is relate my problem ?

Anyone can help me ? Thanks
bobogavin
Newbie
 
Posts: 6
Joined: Sun Aug 06, 2017 10:46 pm

Re: My custom scheme must use absolute path

Postby magreenblatt » Mon Nov 20, 2017 4:09 pm

Are you registering "location" as a standard scheme? See CefSchemeRegistrar documentation.
magreenblatt
Site Admin
 
Posts: 12408
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

Users browsing this forum: Majestic-12 [Bot] and 28 guests