Hi!
Can I call any Delphi code from JavaScript to make some operation and give back the result to browser?
Thanks.
Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
Calling Delphi Code/Event from Javascript
- salvadordf
- Posts: 4620
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Calling Delphi Code/Event from Javascript
Yes. Take a look at the MiniBrowser demo.
Re: Calling Delphi Code/Event from Javascript
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!
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!
- salvadordf
- Posts: 4620
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Calling Delphi Code/Event from Javascript
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.
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.