I registered my own protocol handler and try to whitelist it for XMLHttpRequests, but it doesn't work as expected.
Registering the protocol handler is essentially equivalent to the scheme_test of the cefclient example. Here are the relevant bits:
- Code: Select all
void RegisterCustomSchemes(CefRefPtr<CefSchemeRegistrar> registrar, std::vector<CefString>& cookieable_schemes)
{
registrar->AddCustomScheme("arb", true, false, false);
}
void InitSchemes()
{
CefRegisterSchemeHandlerFactory("arb", "database", new ClientSchemeHandlerFactory());
}
My protocol is called arb and the domain name is database, as you can see.
Now registering a whitelist entry I'm trying this:
- Code: Select all
CefAddCrossOriginWhitelistEntry("http://localhost:8000", "arb", "database", false);
But the following AJAX call fails: "arb://database/people.html" with the message:
- Code: Select all
[0401/103050:INFO:CONSOLE(0)] "XMLHttpRequest cannot load arb://database/people.html?term=bla. Cross origin requests are only supported for HTTP.", source: http://localhost:8000/index.html#/radiograph/new (0)
However, if i omit the target_domain parameter like this, it works:
- Code: Select all
CefAddCrossOriginWhitelistEntry("http://localhost:8000", "arb", "", true);
Did I miss something?
Thanks in advance