8

I do hope that this is not deleted as subjective. The only subjective part might be that 1) my Delphi is better than my PHP and 2) I prefer compiled to interpreted programming languages.

However, the actual (non-subjective) question is - if I choose Delphi and use a TWebBrowser (or similar mechanism) to view/manipulate Google Earth, will I be restricting my available functionality in any way?

Are there some things that I can only do "in a browser" that I can't do "in a VCL browser component"?

[Update] I forgot to say that 1) I am comfortable with Windows only and, 2) the Google Earth functionality is only one part of a larger APP (for me, it is easier to implement that app as a Delphi program than something browser based, but that sounds subjective again, which is why I never mentioned it. I'll just stick with "if I choose Delphi and use a TWebBrowser will I be restricting my available functionality in any way?" as the question, since that can be answered.

Mawg says reinstate Monica
  • 38,334
  • 103
  • 306
  • 551
  • 1
    You'll be restricting yourself to the platform on which your code runs. Typically that would be Windows if you built on TWebBrowser. – David Heffernan Jul 04 '12 at 08:06
  • 1
    I'm [`still wondering`](http://stackoverflow.com/q/9327111/960757) if someone tested [`TChromiumFMX`](http://delphichromiumembedded.googlecode.com/svn/trunk/) on Mac OS, if it's even possible. – TLama Jul 04 '12 at 08:43
  • 1
    Okay, is the question "Delphi" vs "PHP"? if you are _not_ tied to PHP, take a look at Python. – Leonardo Herrera Jul 04 '12 at 14:45
  • 1
    I found that the Chrome Embedded Framework (CEF) offered me much higher performance than I got with IE. Secondly, I found that `TEmbeddedWB` from bsalsa2000.com is a far superior wrapper for InternetExplorer (IShellDocView) than the TWebBrowser that comes installed in delphi. In fact, TWebBrowser's one redeeming quality is that it is built in already. Nothing wrong with using it, if you are happy with it. – Warren P Jul 04 '12 at 19:20
  • a few +1 there. Thanks, as always, Warren. Any recommendaion of yours is always well worthwhile. Btw, there is no "2000" in the URL. More info at http://www.bsalsa.com/product.html – Mawg says reinstate Monica Jul 05 '12 at 02:27

3 Answers3

8

There is no technical reason why not to use the TWebBrowser to display maps, or anything for that matter. In fact, this is a matter of opinion, and most likely you have heard people's opinions telling you not to do so. Unfortunately, Stack Overflow is a Question/Answer site, so a question like this isn't necessarily feasible.

The TWebBrowser wraps an Internet Explorer browser window, and relies on whatever version of IE is installed. Anything which you can open in Internet Explorer can also be opened in the TWebBrowser, Google Earth included. It's a matter of pointing it to a page and loading it. As for technical reasons, there may be some glitches here and there, but I don't see why not.

Jerry Dodge
  • 26,858
  • 31
  • 155
  • 327
  • 2
    +1, where +2 is for answering the question, -1 for *there may be some glitches here and there* because there are some and they are quite critical. – TLama Jul 04 '12 at 08:52
  • lol "glitches". @TLama, it all begins with a proper understanding how this component works and what holes you need to fill to provide a good experience with twebbrowser. – whosrdaddy Jul 04 '12 at 08:55
  • 2
    "Anything which you can open in Internet Explorer can also be opened in the TWebBrowser" might not be exactly 100 % true, but only 99.99 % or so. For one thing, the User Agent reported by the `TWebBrowser` might not be identical to the one reported by the true IE installed. – Andreas Rejbrand Jul 04 '12 at 08:56
  • @AndreasRejbrand, I remember that the User Agent was so tied to the installed browser that if you changed it in your program you actually had to modify the registry and it would change the user agent string of you installed browser. Isn't that true anymore? – Leonardo Herrera Jul 04 '12 at 14:44
  • 1
    Well, to be a bit clear, it may not fit your needs 100% right from the beginning, surely there's some things which need to be understood and tweaked before expecting the `TWebBrowser` to do anything and everything you want. But practically anything is possible with it, just a matter of knowing what holes to fill, just as whosrdaddy says. For example, it is possible to catch javascript events and handle them in Delphi, but it doesn't come ready for this, it needs quite some work to make this possible. But it's still possible. – Jerry Dodge Jul 06 '12 at 00:09
  • +1 A very good point - and one which I had not thought of (any URLs? ;-) – Mawg says reinstate Monica Jul 06 '12 at 01:22
7

Are there some things that I can only do "in a browser" that I can't do "in a VCL browser component"?

The short answer is, that if you know the TWebBrowser (IE based) / DelphiChromiumEmbedded (Webkit) inside-out you are not limited.

Two major browsers I know of, are based on TWebBrowser/IE control - Avant Browser (written in Delphi) and Maxthon (I have used both, and they served me very well, until I completely switched to FF) - never had any compatibility issues with them (compared to IE application).

A good starting point will be the TEmbeddedWB - This package wraps the IWebBrowser interface and Control Library (SHDOCVW.DLL) to allow you to create a customized Web browsing application.

One very important issue, the Web Browser Control has, that it uses IE 7 rendering mode by default. so you will need to specify the IE rendering mode for your own application (see this article). There are other issues but most of them could be configured and customized via the registry FeatureControl keys:

HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl

kobik
  • 21,001
  • 4
  • 61
  • 121
2

Yes, there is one - Chromium Embedded Framework (CEF) is much high performance than IE, especially in the case where your end user's using an earlier version of IE.

CEF is based on Google's open source project Chromium.

I'm using CEF in LIVEditor (my new live html editor) and the result is very very good!.

But note that you'll have to distribute an additional 20 MB files when compressed.

Edwin Yip
  • 4,089
  • 4
  • 40
  • 86