Javascript Execution in CEF

Having problems with building or using the CefGlue .NET/Mono binding? Ask your questions here.

Moderator: fddima

Javascript Execution in CEF

Postby ishanjain » Mon May 18, 2015 6:30 am

Hi,

I want to check the javascript execution and make changes in CEF. Can anyone help me where exactly I can find the javascript execution? Actually I want to track whether my web application has called a particular method of javascript or not?

Thanks
Ishan jain
ishanjain
Techie
 
Posts: 13
Joined: Wed Apr 29, 2015 1:00 pm

Re: Javascript Execution in CEF

Postby magreenblatt » Mon May 18, 2015 11:14 am

ishanjain wrote:Actually I want to track whether my web application has called a particular method of javascript or not?

What method are you trying to track?
magreenblatt
Site Admin
 
Posts: 12383
Joined: Fri May 29, 2009 6:57 pm

Re: Javascript Execution in CEF

Postby ishanjain » Tue May 19, 2015 10:14 am

I have a web application which has HTML and javascript and my javascript has one method lets say "mymethod()" function. Now whenever html calls javascript function, I want to track whether "mymethod()" function has been called or not? And if it is called then I have to do an operation at that time. I can track it if I know which method in the chromium is called whenever html call "mymethod()" function.

So can you help me to resolve this issue?

Thanks
Ishan jain
ishanjain
Techie
 
Posts: 13
Joined: Wed Apr 29, 2015 1:00 pm

Re: Javascript Execution in CEF

Postby magreenblatt » Tue May 19, 2015 10:37 am

How is the "mymethod()" function defined?
magreenblatt
Site Admin
 
Posts: 12383
Joined: Fri May 29, 2009 6:57 pm

Re: Javascript Execution in CEF

Postby ishanjain » Tue May 19, 2015 11:19 am

Take the example of following code. Whenever button is clicked mymethod() runs. So whenever mymethod() runs I want to get notified. In this example on button click it runs but in the various application, it is not necessary it runs on button click only.

"<!DOCTYPE html>
<html>
<head>
<script>
function mymethod() {
document.getElementById("demo").innerHTML = "Paragraph changed.";
}
function mymethod1() {
document.getElementById("demo1").innerHTML = "Paragraph changed1.";
}

</script>
</head>

<body>

<h1>JavaScript in Head</h1>

<p id="demo">A Paragraph.</p>

<button type="button" onclick="mymethod()">Try it</button>

</body>
</html>"
ishanjain
Techie
 
Posts: 13
Joined: Wed Apr 29, 2015 1:00 pm

Re: Javascript Execution in CEF

Postby magreenblatt » Tue May 19, 2015 12:14 pm

If "mymethod()" is a definition that you control as in the above example then just modify the definition to call a natively bound function. See https://bitbucket.org/chromiumembedded/ ... gration.md.
magreenblatt
Site Admin
 
Posts: 12383
Joined: Fri May 29, 2009 6:57 pm


Return to CefGlue Forum

Who is online

Users browsing this forum: No registered users and 20 guests