views:

898

answers:

4

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.

+1  A: 

If it is in fact Chrome as a browser you want to embed into your application, you should check out Google Chrome Frame, it exposes COM interfaces, primarily to integrate into Internet Explorer, but in theory we should be able to access them also.

(I'm not sure because I would like to have a go at this myself, but it's on a (long) list of really neat things to try when I get around to them.) Update: I've had a quick go at it, got a "No interface supported" error, and posted it here.

Stijn Sanders
I think he is talking about the V8 interpreter not about the chrome frame. V8 can be used independly in any application, but we need a wrapper for Delphi.
Francis Lee
Stijn Sanders
I am referring to the V8 interpreter.
Mick
+2  A: 

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.

skamradt
+1  A: 
Wouter van Nifterick
Good info! I considered the SpiderMonkey Bridge (Malzilla uses it), but it is a few years old and I want something that'll work with the new unicode enabled versions of Delphi (2009 and 2010).
Mick
+1  A: 

I've been using the SpiderMonkey bridge also, without any problems. Runs reasonably fast, without a huge footprint, and have had no Unicode issues yet!

Craig McMahon