Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gecko XPCOM usage vs WebKit

I need to embed a web browser in C++ application. As well, I need to reach its javascript methods from Delphi components.

I know that for FF there is Gecko with XPCOM. Is there something like this for WebKit?

like image 874
Dejell Avatar asked Apr 19 '26 04:04

Dejell


1 Answers

WebKit first: there's project called Chromium embedded (Chromium is basically WebKit rendering engine and V8 Javascript engine), that has also Delphi support. After a quick look into headers, I did not find a way to access JS methods, but it allows executing javascript snippets in given frame:

// Execute a string of JavaScript code in this frame. The |script_url|
// parameter is the URL where the script in question can be found, if any. The
// renderer may request this URL to show the developer the source of the
// error.  The |start_line| parameter is the base line number to use for error
// reporting.
execute_java_script: procedure(self: PCefFrame; const jsCode, scriptUrl: PWideChar; startLine: Integer); stdcall;

So the pieces are there, you just need to figure out how to patch them together.

For Gecko, there are Delphi bindings available under a project called d-gecko. But it seems to be a bit outdated and also does not seem to allow accessing the Javascript.

like image 82
plaes Avatar answered Apr 21 '26 16:04

plaes



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!