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.
If you find these projects useful please consider becoming a sponsor with Patreon, GitHub or Liberapay.

Calling Delphi Code/Event from Javascript

Post Reply
szakalyb
Posts: 2
Joined: Thu Feb 02, 2017 3:18 pm

Calling Delphi Code/Event from Javascript

Post by szakalyb »

Hi!

Can I call any Delphi code from JavaScript to make some operation and give back the result to browser?

Thanks.
User avatar
salvadordf
Posts: 4620
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Calling Delphi Code/Event from Javascript

Post by salvadordf »

Yes. Take a look at the MiniBrowser demo.
szakalyb
Posts: 2
Joined: Thu Feb 02, 2017 3:18 pm

Re: Calling Delphi Code/Event from Javascript

Post 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!
User avatar
salvadordf
Posts: 4620
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Calling Delphi Code/Event from Javascript

Post 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.
Post Reply