What I've done in cefclient:
1. Add "remote-allow-origins" in function OnBeforeCommandLineProcessing() in client_browser.cc:
- Code: Select all
void OnBeforeCommandLineProcessing(
CefRefPtr<ClientAppBrowser> app,
CefRefPtr<CefCommandLine> command_line) override {
// Append Chromium command line parameters if touch events are enabled
if (client::MainContext::Get()->TouchEventsEnabled()) {
command_line->AppendSwitchWithValue("touch-events", "enabled");
}
// below I added the line
command_line->AppendSwitchWithValue("remote-allow-origins", "*");
}
2. Assign remote_debugging_port in RunMain() in cefclient_win.cc:
- Code: Select all
//....
CefSettings settings;
if (!sandbox_info) {
settings.no_sandbox = true;
}
// add my code below
settings.remote_debugging_port = 50000;
// ...
When I run, the browser shows, I open Chrome and connect either with url "localhost:50000" or "chrome://inspect", all resulted in a blank page with HTTP 200OK.
When I try to connect the url "http://localhost:50000/json", I got following json result:
- Code: Select all
[ {
"description": "",
"devtoolsFrontendUrl": "https://chrome-devtools-frontend.appspot.com/serve_rev/@523d8b83478e992b99dcbfdf347e06e4e7ac9371/inspector.html?ws=localhost:50000/devtools/page/43AD4B70C428E80EC5958CC542AEEE06",
"faviconUrl": "https://www.gstatic.com/images/branding/searchlogo/ico/favicon.ico",
"id": "43AD4B70C428E80EC5958CC542AEEE06",
"title": "Google",
"type": "page",
"url": "https://www.google.com/",
"webSocketDebuggerUrl": "ws://localhost:50000/devtools/page/43AD4B70C428E80EC5958CC542AEEE06"
} ]
Did I miss anything? Please help. Appreciate your great help.
