mirror of
https://github.com/salvadordf/CEF4Delphi.git
synced 2024-11-16 08:15:55 +01:00
b54a2861c4
RenderProcessHandler and ResourceBundleHandler are now created automatically in TCEFApplication. All their events are now TCEFApplication events.
26 lines
859 B
HTML
26 lines
859 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<body>
|
|
|
|
<h1>Executing JS functions from Delphi demo.</h1>
|
|
|
|
<p>The CEF3 document describing JavaScript integration is here :<br>
|
|
<a href="https://bitbucket.org/chromiumembedded/cef/wiki/JavaScriptIntegration.md">https://bitbucket.org/chromiumembedded/cef/wiki/JavaScriptIntegration.md</a></p>
|
|
|
|
<p>The following button registers <strong>myFunc()</strong> using a "register" function we previously binded to the window in the GlobalCEFApp.OnContextCreated event.</p>
|
|
<button onclick="RegisterJSFunction()">Register JS function</button>
|
|
|
|
<p>After registering the function you can right-click over this demo and select "Execute registered JS function" to execute the function.</p>
|
|
|
|
<script>
|
|
function myFunc() {
|
|
alert("This is myFunc executing!");
|
|
}
|
|
|
|
function RegisterJSFunction() {
|
|
window.register(myFunc);
|
|
}
|
|
</script>
|
|
|
|
</body>
|
|
</html> |