Hi ,
I am trying to use the CefMessageRouterHandler in my application to send some msg back and forth between JS and Java. I created a JS as shown in https://bitbucket.org/chromiumembedded/java-cef/src/8e7fc7e3d4934ffbb7c080c129b264e6db963ea9/java/tests/detailed/handler/binding_test.html?at=master&fileviewer=file-view-default ( I copied the window.cefquery block but changed the "onFailure part" .. I also implement the onQuery in my Java side to handle this request. However, I get Uncaught TypeError: undefined is not a function error on the line where I specify window.cefQuery. Am I missing something ? Should I do some other step for this to work ?
JS side
window.cefQuery({
request: 'CLOSING',
onSuccess: function(response) {
console.log(response);
},
onFailure: console.log("Error ")
});
Java Side
@Override
public boolean onQuery(CefBrowser browser, long query_id, String request,
boolean persistent, CefQueryCallback callback) {
if (request.equals("CLOSING")) {
callback.success("I have no idea y this wont work");
return true;
}
// Not handled.
return false;
}
I jus get the "Error" message along with the undefined error.
Thanks