Page 1 of 1
Calling Delphi Code/Event from Javascript
Posted: Sun May 14, 2017 5:46 pm
by szakalyb
Hi!
Can I call any Delphi code from JavaScript to make some operation and give back the result to browser?
Thanks.
Re: Calling Delphi Code/Event from Javascript
Posted: Sun May 14, 2017 7:28 pm
by salvadordf
Yes. Take a look at the MiniBrowser demo.
Re: Calling Delphi Code/Event from Javascript
Posted: Sun May 14, 2017 7:55 pm
by szakalyb
Hi!
I checked that Demo under D2007.
Unfortunately, it not compiled for some wrong event type declarations. I fixed it, so it started.
ProcessHandler_OnCustomMessage, ProcessHandler_OnWebKitReady are pure procedures on demo, but OnXXX events required procedure of objects.
I created a fake class to it.
But OnWebkitReady, OnDocAvailable never fired to me...
For me it is not clear, where I can find example to Javascript -> Delphi routines/events, with return values on this demo.
Can you help me to see what I'm looking for?
(TTestExtension.mouseover never executed after 'Set mouseover event' popup, if you mentioned that)
Thank You!
Re: Calling Delphi Code/Event from Javascript
Posted: Sun May 14, 2017 9:33 pm
by salvadordf
It's explained with more detail here :
viewtopic.php?f=8&t=42
If you want to make a quick test, download the Delphi 10.2 Starter edition from embarcadero :
https://www.embarcadero.com/products/de ... l-download
If I'm not mistaken it still has a 100% discount and CEF4Delphi works fine in it. After that you can make modifications to make CEF4Delphi work on your Delphi version.