-1

i need your help.

I use webbrowser in my delphi applications for displaying map. For unknown reason it has stopped working in all my apps from yestarday. All my application were working without issues for years.

Example code in delphi:

   WebBrowser1.silent := true;
   WebBrowser1.Navigate('c:\temp\test.html');

Example content of test.html:

<!doctype html>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<html>
<head>
    <script src="https://api.mapy.cz/loader.js"></script>
    <script>Loader.load()</script>
</head>

<body style="margin: 0px;">
    <div id="mapa" style="width:1900px; height:1160px;"></div>
    <script type="text/javascript">
        var stred = SMap.Coords.fromJTSK(1077766.44,675681.75);
        var mapa = new SMap(JAK.gel("mapa"), stred, 19);
        mapa.addDefaultLayer(SMap.DEF_BASE).enable();
    </script>
</body>
</html>

I have tried start my delphi apps on different computers with same result - it does not work on any computer, test web page is not displayed.

I have tried create new test application in Delphi 10.4 CE and in Turbo Delphi 2006 too, in both cases same result - test.html is not displayed in webbroser at all. I can open another web pages in webbrowser for example google.cz.

So it seems to me issue may be with test.html content, but same html file is possible to open in browsers like MS Edge, Opera etc. from same computer without any issues...

Now i'm little lost, because I'm not big expert I would appreciate advise how I can solve this issue.

Thanks

  • https://stackoverflow.com/questions/25843845/how-to-have-delphi-twebbrowser-component-running-in-ie9-mode – Delphi Coder Oct 15 '21 at 06:54
  • I receive this message when attempting to load mapy.cz in Internet Explorer on Windows 10: "Používáte webový prohlížeč, který nemusí správně zobrazit všechny funkce Mapy.cz". Dismissing this results in a blank window. TWebBrowser uses Internet Explorer "under the hood". You may need to switch to TEdgeBrowser – Dave Nottage Oct 15 '21 at 07:08
  • Since HTTPS is used an SSL certificate might fail validation and the request ends. Certificates expire every now and then. – AmigoJack Oct 15 '21 at 07:31

1 Answers1

0

The reason why the mentioned map is no longer showing in TWebBrowser is the fact that TWebBrowser is just a wrapper for Internet Explorer. And since with the last update to the map software support for Internet Explorer 11 (latest version of IE available) has been dropped it means that TWebBrowser is no longer capable of showing the said map properly.

You can read more in Map API change-log here

So I'm afraid you will have to replace the TWebBrowser component in your applications either with TEdgeBrowser which is available from Delphi 10.4 or newer or make use of CEF4Delphi which is an open sourced Delphi component for chromium based browser.

You can read more about TEdgeBrowser and how to set it up in Delphi documentation

SilverWarior
  • 7,372
  • 2
  • 16
  • 22
  • Thanks to all for your replies. I have done some research too and I think it is really not possible to use webbrowser for displaying maps from mapy.cz anymore. But then I must rewrite huge parts of my applications, because they are writteln in Turbo Delphi 2k6 so there are another ways how to connect to SQL etc.... so I'm not very happy for that. So if there will be way how to keep using webbrowser with mapy.cz i will prefer it. I will try to dig more informations later. thanks for now. – user14668421 Oct 15 '21 at 17:47
  • CEF4Delphi is compatible with your current Delphi version. In fact it supports even ancient Delphi versions like Delphi 7. So replacing TWebBrowser with CEF4Delphi might provide you fastest way to get your applications full operational again. But you should still consider upgrading to newer Delphi version in near future. – SilverWarior Oct 16 '21 at 12:58