Handle JS events in CEf

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.

Handle JS events in CEf

Postby Nidhi » Wed Jan 11, 2017 7:59 am

Hi,

How do we handle JS event handling in CEF.
My problem statement is that I click a button, it should change the text on HTML page and return that value to CEF.
Nidhi
Techie
 
Posts: 48
Joined: Fri Sep 02, 2016 6:23 am

Re: Handle JS events in CEf

Postby Phylanx » Wed Jan 11, 2017 8:49 am

The detailed MainFrame example was very enlighting for me.
In there have a look on the Bookmark buttons "Binding Test" and "Binding Test 2", also the HTML pages that are delivered : .src/java/tests/detailed/handler/binding*.html
In MainFrame application a CefMessageRouter is used to append MessageRouterHandlers.

I quickly understood how this should work like...
Phylanx
Expert
 
Posts: 201
Joined: Thu Aug 11, 2016 8:17 am

Re: Handle JS events in CEf

Postby Nidhi » Wed Jan 11, 2017 9:07 am

Can you please provide a link/share code for it ?
Nidhi
Techie
 
Posts: 48
Joined: Fri Sep 02, 2016 6:23 am

Re: Handle JS events in CEf

Postby Nidhi » Wed Jan 11, 2017 10:05 am

I am able to resolve the issue, but my problem is that the return value is JS object like my JS code is

var msg=var msg = document.getElementById("text").value;
how am I suppose to get the string value from this object in CEF ?
Nidhi
Techie
 
Posts: 48
Joined: Fri Sep 02, 2016 6:23 am

Re: Handle JS events in CEf

Postby Phylanx » Thu Jan 12, 2017 7:50 am

Sorry, i just saw JavaScript and thought you might use the Java-CEF.
I don't know the CEF usecase, maybe another user can help here?
Phylanx
Expert
 
Posts: 201
Joined: Thu Aug 11, 2016 8:17 am

Re: Handle JS events in CEf

Postby magreenblatt » Thu Jan 12, 2017 10:01 am

Nidhi wrote:Hi,

How do we handle JS event handling in CEF.
My problem statement is that I click a button, it should change the text on HTML page and return that value to CEF.

See https://bitbucket.org/chromiumembedded/ ... t-bindings
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 104 guests