- Code: Select all
virtual bool OnQuery(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
int64 query_id,
const CefString& request,
bool persistent,
CefRefPtr<Callback> callback) OVERRIDE {
// Only handle messages from the test URL.
const std::string& url = frame->GetURL();
if (url.find(kTestUrl) != 0)
return false;
const std::string& message_name = request;
if (message_name.find(kTestMessageName) == 0) {
// Reverse the string and return.
std::string result = message_name.substr(sizeof(kTestMessageName));
// std::reverse(result.begin(), result.end());
callback->Success(result);
return true;
}
return false;
}
the callback->Success(result) seems to send the result to the browser, is there a way for me to be able to retrieve the value of the result from cefclient using the instance of the browser?
Thank you so much!