TWebbrowser can't render specific page correctly (Delphi 11)

294 Views Asked by At

I'm trying to display the page http://ekloges-prev.singularlogic.eu/2019/v/home/municipaldistricts/814/ in TWebBrowser but I get the error:

unable to get property 'remove' of undefined or null reference

But the page http://ekloges-prev.singularlogic.eu/v2012b/public/index.html#{%22cls%22:%22level%22,%22params%22:{%22level%22:%22ep%22, %22id%22:36}} displays as expected. Both pages contain JavaScript and both open normally in Chrome, but it looks like the first page requires some extra setup in TWebBrowser to render properly. Here is an application to demonstrate the problem:

unit Unit5;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.OleCtrls, SHDocVw, Vcl.StdCtrls;

type
  TForm5 = class(TForm)
    Button1: TButton;
    WebBrowser1: TWebBrowser;
    procedure Button1Click(Sender: TObject);
  end;

var
  Form5: TForm5;

implementation

{$R *.dfm}

procedure TForm5.Button1Click(Sender: TObject);
begin
  // not shown correctly, same with .Navigate2()
  WebBrowser1.Navigate('http://ekloges-prev.singularlogic.eu/2019/v/home/municipaldistricts/814/');

  // this one shows correctly
  //WebBrowser1.Navigate('http://ekloges-prev.singularlogic.eu/v2012b/public/index.html#{%22cls%22:%22level%22,%22params%22:{%22level%22:%22ep%22,%22id%22:36}}');
end;

end.
0

There are 0 best solutions below