Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I use Google Chrome's V8 JavaScript interpreter from Delphi?

I'd like to embed the V8 JavaScript interpreter that ships with Google Chrome within my Delphi application. I'm aware of the chromium embedded open-source project from Google, but I'd like to know if anyone was aware of any Pascal/Delphi wrappers?

There is an example project included with the zip file on the site I linked, which is written in C++. If nothing else, I'll slowly and painfully work to convert it.

UPDATE:
I just want to embed the V8 JavaScript interpreter, not the Chromium browser.

like image 690
Mick Avatar asked Feb 24 '10 03:02

Mick


2 Answers

The most ideal solution would be to create a wrapper, preferably which consumes the original source unmodified, and compile that wrapper to an OBJ file (using C++) which then is linked into Delphi, where another "wrapper" exposes the engine via a more standard object pascal syntax. This approach would then allow for changes in the engine without the need for a complete conversion each time new functionality or additional performance is added. The only disadvantage of this approach is that there will be some performance lost while navigating the layers...but I would expect it to be minimal.

like image 157
skamradt Avatar answered Sep 22 '22 09:09

skamradt


For the record: hgourvest has posted Delphi Chromium Embedded to Google Code.

Edit 2013-01-15:

Another project by the same author this time wrapping CEF3: DCEF3

like image 30
Nedko Avatar answered Sep 21 '22 09:09

Nedko