We are trying to change the builtin browser component from TWebBrowser to TChromium.
It is used mostly for displaying maps from Google and Bing. The communication from the javascript to Delphi is done with COM.
When trying to change the browser to TChromium it fails to compile this code.
if supports(fBrowser.defaultInterface, IOleObject, fOLE) then
because defaultInterface is missing from TChromium.
EDIT:
Is it possible to still communicate from javascript to Delphi with Chromium?
I’m aware of that they are not compatible and I have to rewrite code. I just want to know how to get a result from javascript to delphi. Note I am using Delphi 2007 so the extended RTTI cannot be used.
Regards
Roland Bengtsson
Using TChromium, you can invoke scripts easily via
ExecuteJavaScript. And you can invoke Delphi code from scripts, which you can use to send return values back from a JavaScript function to Delphi.See this question and my answer there about doing this using extensions.
There also seems to be work in progress for functions like
EexecuteScriptAndReturnValuebut as the time of writing they are not contained in the trunk.And regarding
TWebBrowser.DefaultInterfaceI agree with Cosmin: the best analogy is probablyTChromium.Browseras you can access frames and subsequently DOM, etc. from there.